5.0
API
Functions
isValidKey

isValidKey Function

The isValidKey function checks if a keyboard event is triggered by a valid key without any specified invalid keys or modifier keys. This function is particularly useful when you want to prevent entering edit mode for a cell on certain keys.

type isValidKey = (event: React.KeyboardEvent, invalidKeys?: string[]) => boolean;

Parameters

ParameterTypeDescription
eventReact.KeyboardEventThe keyboard event to check.
invalidKeysstring[] (optional)An optional array of additional keys that should be considered invalid.

Returns

TypeDescription
booleantrue if the event is triggered by a valid key without any specified invalid keys or modifier keys, false otherwise.