-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Labels
✨ feature requestNew feature or requestNew feature or request
Description
What problem does this feature solve?
In native web, you can prevent further event listeners from running by calling stopImmediatePropagation
.
This doesn't work when using Vue, because Vue puts all functions into its own array and executes them regardless, from a single native event handler.
Example:
<!-- consumer of ui-form component -->
<ui-form @submit='...'>
</ui-form>
<!-- ui-form component itself -->
<form @submit='submit'><slot /></form>
<script>
function submit(e) {
if (invalid) e.stopImmediatePropagation();
}
</script>
In this example the alternative would be to have the component emit a custom, different event; that consumer could listen to.
Or add an artificial DOM wrapper so that stppPropagation
could be used instead.
What does the proposed API look like?
No new public API, but a change of behavior to match intuitive native web expectations.
Would be nice if somehow Vue could notice a call to stopImmediatePropagation and act accordingly.
a631807682, cjinhuo and f0urfingeredfisha631807682 and proud-muraoka
Metadata
Metadata
Assignees
Labels
✨ feature requestNew feature or requestNew feature or request