MCPcopy Create free account
hub / github.com/testing-library/user-event / isCursorAtStart

Function isCursorAtStart

src/utils/edit/cursorPosition.ts:14–21  ·  view source on GitHub ↗
(element: Element)

Source from the content-addressed store, hash-verified

12}
13
14export function isCursorAtStart(element: Element) {
15 const {selectionStart, selectionEnd} = getSelectionRange(element)
16
17 return (
18 selectionStart === selectionEnd &&
19 (selectionStart ?? /* istanbul ignore next */ 0) === 0
20 )
21}

Callers 1

functional.tsFile · 0.90

Calls 1

getSelectionRangeFunction · 0.90

Tested by

no test coverage detected