You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug seems to have been introduced in version 0.3.9. I'm suspecting (without any scientific proof 🧑🔬) that it was introduced either by #777 or #735.
In version 0.3.8 and older it works as expected.
The text was updated successfully, but these errors were encountered:
As @danielstocks pointed out, this seems to be caused by #735 because it uses await 0 to dedupe synchronous mutation calls.
If SWR supports the case to call the mutate function synchronously in an input handler, we might have to re-consider the approach #735 introduces.
Bug report
Description / Observed Behavior
I'm attempting to use the following code as suggested by @sergiodxa to mutate state while typing in a text input.
The mouse cursor does not maintain its position within the text input field (if placed anywhere except at the end) while mutating the state.
Controlling an input only with
React.useState
works as intended.Expected Behavior
Cursor should maintain it's current position within the text input.
Repro Steps / Code Example
https://codesandbox.io/s/upbeat-thompson-qqeof?file=/src/App.js
Additional Context
SWR version: 0.4.2
This bug seems to have been introduced in version 0.3.9. I'm suspecting (without any scientific proof 🧑🔬) that it was introduced either by #777 or #735.
In version 0.3.8 and older it works as expected.
The text was updated successfully, but these errors were encountered: