You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`onKey` (required) | the function executed after a key event | n/a |
34
43
|`type`| keyup or keydown |`'keydown'`|
35
-
|`target`| the element you want to attach the event to, it can be an **existing** DOM element or a CSS selector (in that case, you will need to add a `tabIndex='0'` to your element, otherwise the event won't be caught) |`document`|
44
+
|`target`| the element you want to attach the event to: an **existing** DOM element, a CSS selector (you will need to add `tabIndex='0'` to your element, otherwise the event won't be caught), or a **React ref** (`RefObject<HTMLElement>`) — if a ref is passed and `.current` is `null`, the listener is silently skipped|`document`|
36
45
|`preventInputConflict`| prevent onKey from firing if you have an onChange on an input, a textarea or a select |`false`|
37
46
|`preventContentEditableConflict`| prevent onKey from firing if the user is editing the DOM via contenteditable="true", usually used by WYSIWYG editors |`false`|
0 commit comments