CreateAsyncThunk - not works with inputs/text area - cursor jumps. Why? #2984
Unanswered
guilhermedelucas
asked this question in
Q&A
Replies: 1 comment
-
Any cases of "the cursor jumping" are really a React question, not a Redux question. The most common answer to that is that you may be destroying and re-creating the input components accidentally. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have an action created with createAsyncThunk, that is dispatched on a input change. I have some logic on the async thunk to run some calculation, return the calculation. And then when the action is fulfilled I set the reducer state.
When I use the createAsyncThunk, for the input case, if I type with the cursor on the middle or beginning of the text, it jumps to the end after typing.
I fixed the issue re-designing my code, and using the logic as side effect of the state change, not with the async thunk.
But I would like to know, what happens/why results in this behaviour on the text are or input elements?
Anyone that can clarify this question, I would be really glad.
Beta Was this translation helpful? Give feedback.
All reactions