MCPcopy Create free account
hub / github.com/adobe/react-spectrum / isValidInputKey

Function isValidInputKey

packages/react-aria/src/interactions/usePress.ts:1205–1210  ·  view source on GitHub ↗
(target: HTMLInputElement, key: string)

Source from the content-addressed store, hash-verified

1203]);
1204
1205function isValidInputKey(target: HTMLInputElement, key: string) {
1206 // Only space should toggle checkboxes and radios, not enter.
1207 return target.type === 'checkbox' || target.type === 'radio'
1208 ? key === ' '
1209 : nonTextInputTypes.has(target.type);
1210}

Callers 2

isValidKeyboardEventFunction · 0.85

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected