(element: Element)
| 2 | import {getValue} from './getValue' |
| 3 | |
| 4 | export function isCursorAtEnd(element: Element) { |
| 5 | const {selectionStart, selectionEnd} = getSelectionRange(element) |
| 6 | |
| 7 | return ( |
| 8 | selectionStart === selectionEnd && |
| 9 | (selectionStart ?? /* istanbul ignore next */ 0) === |
| 10 | (getValue(element) ?? /* istanbul ignore next */ '').length |
| 11 | ) |
| 12 | } |
| 13 | |
| 14 | export function isCursorAtStart(element: Element) { |
| 15 | const {selectionStart, selectionEnd} = getSelectionRange(element) |
no test coverage detected