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

blur and focus events should not bubble through DOM #771

Closed
romansp opened this issue Feb 21, 2023 · 0 comments · Fixed by #772
Closed

blur and focus events should not bubble through DOM #771

romansp opened this issue Feb 21, 2023 · 0 comments · Fixed by #772
Labels
bug Something isn't working

Comments

@romansp
Copy link
Contributor

romansp commented Feb 21, 2023

Describe the bug
When triggering focus/blur events on the element its ancestor nodes also receive focus/blur when they should not.

Per MDN docs focus and blur events don't bubble in DOM. But related focusin and focusout do bubble.
https://developer.mozilla.org/en-US/docs/Web/API/Element/focus_event
https://developer.mozilla.org/en-US/docs/Web/API/Element/blur_event

Expected behavior
focus or blur events should not bubble in DOM.

Device:

  • Version 8.7.1

Will open a PR soon with updated test cases.

@romansp romansp added the bug Something isn't working label Feb 21, 2023
romansp added a commit to romansp/happy-dom that referenced this issue Feb 21, 2023
romansp added a commit to romansp/happy-dom that referenced this issue Feb 22, 2023
capricorn86 added a commit that referenced this issue Feb 23, 2023
#771@patch: Don't bubble `focus` and `blur` events through DOM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant