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

Synthetic events violate non-bubbling event specification #12786

Closed
CITguy opened this issue May 11, 2018 · 2 comments
Closed

Synthetic events violate non-bubbling event specification #12786

CITguy opened this issue May 11, 2018 · 2 comments

Comments

@CITguy
Copy link

CITguy commented May 11, 2018

Do you want to request a feature or report a bug?
Bug

Current Behavior

Native blur and focus events do not bubble, but synthetic events for onBlur and onFocus do (which violates the non-bubbling event specification).

As it is currently implemented in React 16, onBlur behaves more like a native focusout event and onFocus behaves more like a native focusin event.

Demos

React 15 demo: https://codepen.io/CITguy/pen/gzzoQj/
React 16 demo: https://codepen.io/CITguy/pen/PeRRwz/

Expected Behavior

Synthetic events for onBlur and onFocus should not bubble.

Tested

OS: Mac OS 10.11.6 and 10.13.4 (no affect on bug)
Browsers: Chrome 66, Firefox 60 (no affect on bug)
React versions: 15.6.2 and 16.3.2 (bug present in both versions)

@aweary
Copy link
Contributor

aweary commented May 11, 2018

This is a known and intentional deviation from native event propagation behavior. It's possible this may change in the future. See #6410 for more information.

@aweary aweary closed this as completed May 11, 2018
@CITguy
Copy link
Author

CITguy commented May 12, 2018

@aweary: Should it be documented as such? https://reactjs.org/docs/events.html#focus-events doesn't mention anything about the focus and blur events deviating from native event bubbling.

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

No branches or pull requests

2 participants