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

Fix event handler during capture phase #2062

Merged
merged 2 commits into from
Sep 18, 2021

Conversation

mc1098
Copy link
Contributor

@mc1098 mc1098 commented Sep 18, 2021

Description

The global multiplex registers an event listeners on the body element
and then we do the event bubbling manually in Yew, however, because we
were still registering event listeners to run on the bubbling phase
events that do not bubble (like blur) never reach the body element.

I just adjusted some of the Mixin testing code from click/clicked to action
so I could reuse it without pretending a blur event was a click 😅

Fixes #2061

Checklist

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

mc1098 added 2 commits September 18, 2021 01:08
Adds a failing test to identify the issue raised in yewstack#2061
The global mutltiplex registers an event listeners on the body element
and then we do the event bubbling manually in Yew, however, because we
were still registering event listeners to run on the bubbling phase
events that do not bubble (like blur) never reach the body element.
@siku2
Copy link
Member

siku2 commented Sep 18, 2021

Thanks for adding a test too!

@siku2 siku2 merged commit 99a9134 into yewstack:master Sep 18, 2021
@mc1098 mc1098 deleted the event-during-capture branch September 19, 2021 06:10
@voidpumpkin voidpumpkin added the A-yew Area: The main yew crate label Nov 26, 2021
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some events doesn't work since listener multiplexer update
3 participants