-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(batch): run event-triggered changes immediately
When react-easy-state changes are triggered from the main event loop, they must run inside the main event loop, instead of being batched in the microtask. Otherwise, the cursor will jump to the end of input elements, since the change can't be tied back to the action taken. React batches changes caused inside an event loop, so we can rely on the normal React setState batching.
- Loading branch information
1 parent
f3038a2
commit 31e541c
Showing
2 changed files
with
76 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters