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

Add possibility to cancel bubbling #2172

Merged
merged 4 commits into from
Nov 22, 2021
Merged

Conversation

voidpumpkin
Copy link
Member

@voidpumpkin voidpumpkin commented Nov 21, 2021

Description

Makes stop_propagation work.
Add some documentation on the topic

Fixes #2130

Checklist

  • I have run cargo make pr-flow
  • I have reviewed my own code
  • I have added tests

@voidpumpkin voidpumpkin added documentation A-yew Area: The main yew crate labels Nov 21, 2021
@voidpumpkin voidpumpkin self-assigned this Nov 21, 2021
@mc1098
Copy link
Contributor

mc1098 commented Nov 21, 2021

Did you try using stop_propagation on the event with this solution? 😏

@voidpumpkin
Copy link
Member Author

Did you try using stop_propagation on the event with this solution? smirk

Omg it works

@mc1098
Copy link
Contributor

mc1098 commented Nov 21, 2021

Sorry 😞 this is what I meant - checking cancel_bubble will let you know if a user called stop_propagation :)

@voidpumpkin
Copy link
Member Author

Sorry disappointed this is what I meant - checking cancel_bubble will let you know if a user called stop_propagation :)

updated accordingly

@yewstack yewstack deleted a comment from github-actions bot Nov 21, 2021
Copy link
Contributor

@mc1098 mc1098 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small typo but LGTM apart from that

packages/yew/src/virtual_dom/listeners.rs Outdated Show resolved Hide resolved
packages/yew/src/virtual_dom/listeners.rs Outdated Show resolved Hide resolved
packages/yew/src/virtual_dom/listeners.rs Outdated Show resolved Hide resolved
voidpumpkin and others added 3 commits November 21, 2021 22:56
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
Co-authored-by: mc1098 <m.cripps1@uni.brighton.ac.uk>
@ranile
Copy link
Member

ranile commented Nov 22, 2021

I've never worked with event bubbling so I would prefer to leave this PR review to someone else

@mc1098 mc1098 merged commit 3742fde into yewstack:master Nov 22, 2021
@voidpumpkin voidpumpkin deleted the bubbling branch December 5, 2021 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-yew Area: The main yew crate documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No way to stop event bubbling per callback
4 participants