New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stopPropagation on actions is broken #515
Comments
They got moved to the document because the events were getting re-added on every update. That would cause the event to fire multiple times. I'm pretty sure I tried a few approaches to prevent it from happening, but resorted to keeping the events on the document as a last resort. If there is a smarter approach I'd love to check it out. |
Ah that makes sense. I don't have a proposed solution as of yet, but the docs at least are incorrect in saying it'll work. I'll have to think and play with it a bit. |
True. If there isn't an easy solution I could remove it from the docs (at least for now). |
I couldn't figure out any good solution myself. Since the event listener I didn't want to trigger was under my control, I added a quick hack to see if the target had a 'unicorn:***.stop' attribute and skipped the work. Not a general solution but a sufficient workaround for me for now. |
It looks like at some point, the action event handlers were moved to the document (checking that the target is correct). It seems like this totally breaks the .stop modifier. That calls stopPropagation, but that doesn't work if its an event on the document. There is nothing to stop propagation to. The intended behavior would seem to be to stop propagation from the element the action is on to parent elements, but that isn't working if the event is actually on the document.
The text was updated successfully, but these errors were encountered: