-
Notifications
You must be signed in to change notification settings - Fork 47k
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: event.preventDefault is wrecking havoc with startTransition #18020
Comments
I don't understand what is happening here. This is odd. |
@gaearon - you don't understand what incorrect behavior my repro is showing, or are you saying you can't tell why / how React is broken? You added the "Bug" label and removed "Unconfirmed" so I assume the latter but let me know if you need me to clarify |
Here's what is going on: The call of react/packages/legacy-events/ReactGenericBatching.js Lines 41 to 45 in 241c446
Instead, they are flushed at the beginning of the react/packages/react-reconciler/src/ReactFiberWorkLoop.js Lines 1243 to 1249 in 241c446
And no timeout would be scheduled again for some reason. Thus the placeholder is never showed. |
@gaearon I'd love to if it's not too late to do it this weekend. |
Anytime! In general, all issues tagged with Concurrent Mode would benefit from failing tests. Even if we don't get to fixes soon. |
Woo hoo - thanks everyone!!! 👊👌💯 |
React version: 241c446
Steps To Reproduce
https://codesandbox.io/s/romantic-gates-2hrjp
Note that steps 2 and 3 are optional. No matter what, the preventDefault that's called in step 4 causes this incorrect behavior no matter whether steps 2 or 3 have been exercised.
Link to code example: see above
The current behavior
startTransition should suspend after the timeout even if event.preventDefault is called.
The expected behavior
it does not
The text was updated successfully, but these errors were encountered: