vanilla-caret-js
Set and get Caret position (contenteditable or TextArea) using Vanilla JavaScript
Set and get Caret position (contenteditable or TextArea) using Vanilla JavaScript
usePreserveInputCaretPosition tracks the input caret position and place it at the correct position so user can have a natural typing experience.
micro lib for control caret