Skip to content
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

Added a propagate modifier to let other listeners catch events #85

Merged
merged 2 commits into from
Oct 5, 2019

Conversation

pirhoo
Copy link
Contributor

@pirhoo pirhoo commented Jul 22, 2019

This modifier allows several listeners to catch the same event.

It might solve issue #78 as it gives a neat way to bind the same key on different elements. This will work:

 <my-component v-shortkey="['ctrl', 'alt', 'o']" @shortkey.propagate="anAction()"></my-component>
 <my-component v-shortkey="['ctrl', 'alt', 'o']" @shortkey.propagate="aDifferentAction()"></my-component>

I added a few tests for edge cases.

Thanks a heap ✌️

@pirhoo pirhoo changed the title Added a propagate modifier to let other listener catch events Added a propagate modifier to let other listeners catch events Jul 22, 2019
@fgr-araujo
Copy link
Owner

I'll check!
Thank you

@fgr-araujo fgr-araujo merged commit 7c2d50c into fgr-araujo:master Oct 5, 2019
@DennisOng
Copy link

Ran into this today as well, thanks for this PR @pirhoo, and @iFgR for this great package!

Would you be able to tag this new release for this?

@pirhoo
Copy link
Contributor Author

pirhoo commented Nov 11, 2019

Looks like there is a typo in the new modifier ("propagte" instead of "propagate"). I'll do another pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants