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
Fixes https://github.com/facebook/react/issues/20966 #20985
Conversation
Comparing: 10cc400...84a5591 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
Can you please make a sandbox so that we can check the behavior before and after? |
Sure thing! I'll do so later today, it's currently 2AM and i have got to sleep 😄 |
@gaearon I've added the codesandbox and a little more context to the original post. The codesandbox uses the latest version of React on NPM. I wanted to add another sandbox with my fork but I haven't found a way to make monorepos work with NPM + Github installs. |
So this is test-only, and doesn't fix issues observable by user? Seems a bit unfortunate to add code for this. |
@gaearon it happens whenever someone programmatically fires the |
Can you explain in more detail what gives you certainty that this change only affects programmatic firing? I'm asking because the symmetrical change happened in #17675, but it's curious that it wasn't mirrored for So I don't want to rush this unless we understand:
|
I could not find information about this behaviour in the spec so I created a Sandbox to see how it works in Chrome. My event listeners don't run when entering/leaving a disabled button element with my mouse which is also how React currently does it. I did find this Firefox issue: https://bugzilla.mozilla.org/show_bug.cgi?id=329509 which states that there was actually a bug that Firefox would not dispatch programmatic events on disabled elements, implying that that should work. I've verified this in the aformentioned CodeSandbox, in Chrome, my event listeners do trigger when programmatically firing the In this sandbox I've set up an example with React. What is odd to me is that even though the button is not disabled, the event listener added as a Would this be a bug in itself, intended behaviour or error on my end? Please advise. |
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated. |
Bump. |
um, what? |
Apologies for closing. We've accidentally pushed a master branch to the repo (due to an old fork), then deleted it, and this lead to a bunch of PRs getting auto-closed. GitHub seems confused and unfortunately does not offer a way to reopen this against |
Summary
Please see this issue: #20966
The issue described that
onMouseEnter
did work as intended which gave me a pointer for where to look. Props on the codebase! First time I'm looking at it and it does make sense.Test Plan
I added tests that covered the cases described in #20966 which initially failed, after I added the code needed, the tests passed.
I've also created a codesandbox with the latest React release: https://codesandbox.io/s/dreamy-boyd-ssbrc?file=/src/index.js
This problem doesn't occur when using React on the web & using a mouse to hover/click on a disabled button because React doesn't normally fire the
mouseover
event this way. It does occur when manually triggering a bubbling mouseover event on a disabled button.