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

Function isValidInputKey

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

Source from the content-addressed store, hash-verified

1191]);
1192
1193function isValidInputKey(target: HTMLInputElement, key: string) {
1194 // Only space should toggle checkboxes and radios, not enter.
1195 return target.type === 'checkbox' || target.type === 'radio'
1196 ? key === ' '
1197 : nonTextInputTypes.has(target.type);
1198}

Callers 2

isValidKeyboardEventFunction · 0.85

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected