@editorjs/caret
Utils useful for work with caret for Editor.js tools development
Installation
npm install @editorjs/caret
Function list
- checkContenteditableSliceForEmptiness - Checks content at left or right of the passed node for emptiness.
- focus - Set focus to contenteditable or native input element
- getCaretNodeAndOffset - Returns TextNode containing a caret and a caret offset in it
- getContenteditableSlice - Returns slice of the contenteditable html element from caret position to the start or end (depending on direction)
- getRange - Returns the first range
- isCaretAtEndOfInput - Checks if caret is at the end of the passed input
- isCaretAtStartOfInput - Checks if caret is at the start of the passed input
save - Saves caret position using hidden
About CodeX
CodeX is a team of digital specialists around the world interested in building high-quality open source products on a global market. We are open for young people who want to constantly improve their skills and grow professionally with experiments in cutting-edge technologies.
| 🌐 | Join 👋 | Twitter | Instagram | | -- | -- | -- | -- | | codex.so | codex.so/join |@codex_team | @codex_team |