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

Function hasSelectionSupport

src/utils/edit/selectionRange.ts:20–32  ·  view source on GitHub ↗
(
  element: Element,
)

Source from the content-addressed store, hash-verified

18}
19
20export function hasSelectionSupport(
21 element: Element,
22): element is
23 | HTMLTextAreaElement
24 | (HTMLInputElement & {type: selectionSupportType}) {
25 return (
26 isElementType(element, 'textarea') ||
27 (isElementType(element, 'input') &&
28 Boolean(
29 selectionSupportType[element.type as keyof typeof selectionSupportType],
30 ))
31 )
32}
33
34export function getSelectionRange(
35 element: Element,

Callers 2

getSelectionRangeFunction · 0.85
setSelectionRangeFunction · 0.85

Calls 1

isElementTypeFunction · 0.90

Tested by

no test coverage detected