-
Notifications
You must be signed in to change notification settings - Fork 46.7k
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
Bug fix for issue 5202 #6226
Bug fix for issue 5202 #6226
Conversation
Thanks @antoaravinth! |
No tests? |
@yaycmyk It's a little annoying to add unit tests for every type of event. Since the native events need to be forged, they're of minimal value anyway, since all you're testing is the forged event. Such tests would make a lot more sense if/when we do in-browser testing (but the tests would need to be written differently anyway, using webdriver/whatever, which we currently don't support). That said, if you'd like to submit a PR that adds a test for this event type, we'd gladly accept. |
Was this the correct fix? I find it a bit weird that we seem to already normalizing |
@@ -296,6 +297,16 @@ var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, { | |||
mountAt | |||
); | |||
ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent( | |||
topLevelTypes.topFocusIn, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't feature detected. Note:
https://developer.mozilla.org/en-US/docs/Web/Events/focusin
Firefox (Gecko): Not supported.
This would need to be normalized, but if we do then it works exactly like focus/blur. So I think we should revert.
I think we should still support the event name (or at the very least warn and say "use focus/blur", but that seems dumb). If the behavior is the same in our polyfilled environment, we should just map them to the same behavior/implementation. |
So far we have tried to have only way to do something. Why break this tradition? It’s the same as
IMO it actually sounds really sensible. This is a great opportunity to warn the user in a very specific and useful way. I think we should revert this PR but add a warning. |
Warning is fine. Not sure about mapping it since that means we need to have logic and checks for it in prod. Why is it important to map if there is a warning and we never supported it in the past? |
👍 |
This has been reverted in #6274. Sorry about the back and forth on this! |
@gaearon @sebmarkbage Thanks. That make sense and I agree with you guys. Probably I will add warnings as discussed here. |
Hi All,
Bug fix for #5202. It looks fine to me, however let me know if anything is missing. If not, can add test case and close this! Thanks.