Closed ahtohbi4 closed 2 years ago
@renato-bohler, looking at the code for manageCaretPosition I wonder why on the 'change' case , instead of moving the cursor to the first unfilled position it is not moved instead to the first valid position?
Facing similar issue, when value is entered and try to edit it, cursor moves to the end of field.
I had this issue and the solution is to manually manage your caret position Put this in your onChange function
const caret = event.target.selectionStart; const element = event.target; window.requestAnimationFrame(() => { element.selectionStart = caret; element.selectionEnd = caret; });
Why is this not yet fixed, it destroy UX
@renato-bohler Is this fixed?
No, I just closed it since apparently there's a workaround for that. I'm accepting PRs, but I'm not putting too much time into maintaining this repository.
What are you reporting?
What is the current behavior?
When you type some value in a field with
createNumberMask
orcreateTextMask
, place the text cursor in the middle of the value and try to add some, the cursor will move to the end of the value.What is the expected behavior?
The cursor should stay on position after the typed symbol.
Sandbox Link
You can reproduce this behavior on your Sandbox.
What's your environment?