Package Exports
- caret-position2
- caret-position2/get
- caret-position2/set
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (caret-position2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
caret-position

Get and set the user's text selection on an input or text area.
See test.html for example usage.
API
// Set caret position after the first character
caretPosition.set(input, 1)
caretPosition.get(input) // -> { start:1, end:1, caret:1 }
// Set text selection to the second and third character
caretPosition.set(input, 1, 3)
caretPosition.get(input) // -> { start:1, end:3, caret:3 }