+ 1
How to control cursor movement in a textarea tag using buttons...
How do I control the cursor in a <input type="text"/> tag using other buttons... Like the "<" and ">" buttons in the code below?👇👇 https://code.sololearn.com/WWHai17dPP8p/?ref=app
5 Respostas
+ 2
It's tricky: as soon as user ciick on button, the text zone with cursor lost focus, so you cannot know the last cursor position... The only workaround would be to implement and handle yourself the cursor display/position/movement plus keyboard inputs... that's not impossible (advanced web editor tends to use more or less this technic) but cannot be easy and fast done ^^
+ 1
Set cursor on input element with focus method then use selectionStart and selectionEnd methods to control and set cursor position.
https://code.sololearn.com/WV4O5fBs53Jc/?ref=app
+ 1
... then you need to build custom input with cursor, that is tricky.
0
Calviղ is there any way to prevent the keyboard from coming up?