Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react input cursor jump end

onChange(event) {

      const caret = event.target.selectionStart
      const element = event.target
      window.requestAnimationFrame(() => {
        element.selectionStart = caret
        element.selectionEnd = caret
      })

      // your code
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #react #input #cursor #jump
ADD COMMENT
Topic
Name
2+2 =