Replies: 2 comments
-
The inverse is also an issue... passing CustomEvent payloads to vue events. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Any news about this topic? I just encountered these problems as well. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I recently came across vuejs/vue#12433 because I have a use case for this feature too - and saw that the original requester was asked to bring it here to the RFCs process but couldn't find any such issue/PR/discussion yet.
Essentially, I'm using Vue to build some Custom Elements / native web components which emit events. As noted in the 'Events' section of the Vue Web Components doc:
The challenge here is that, because params are fed directly through to
options.detail
on the CustomEvent constructor, I don't see any way to set other Event options - particularlybubbles
andcancelable
.These are important features for native/DOM event handling, and it seems to me like it's not sufficient to just assume one setting always holds because presumably developers using this feature are doing so because (like me) their architecture is not vanilla "Vue-all-the-way-down".
It seems possible to work around my specific bubbling requirement by manually raising a CustomEvent and setting composed
true
, to allow it to bubble out of the shadow root and up through parents:...But I don't see how it can be done today without the
composed
option (which I guess could be a problem for users with multiple nested shadow roots in their page?).I'm new to Vue's codebase and RFC process, but hopefully we can find a way to support this extra configuration that's still consistent-enough with what users are familiar with in normal Vue
$emit
?Beta Was this translation helpful? Give feedback.
All reactions