From 11dfc46e84d58327f426aea9b2e09b4fa62f89a6 Mon Sep 17 00:00:00 2001 From: moklick Date: Wed, 26 Mar 2025 09:26:36 +0100 Subject: [PATCH] chore(useKeyPress): prevent event swallowing for buttons #5037 --- packages/system/src/utils/dom.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/system/src/utils/dom.ts b/packages/system/src/utils/dom.ts index 2311153f..4195ea3a 100644 --- a/packages/system/src/utils/dom.ts +++ b/packages/system/src/utils/dom.ts @@ -35,7 +35,7 @@ export const getDimensions = (node: HTMLDivElement): Dimensions => ({ export const getHostForElement = (element: HTMLElement | EventTarget | null): Document | ShadowRoot => ((element as Partial | null)?.getRootNode?.() as Document | ShadowRoot) || window?.document; -const inputTags = ['INPUT', 'SELECT', 'TEXTAREA']; +const inputTags = ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON']; export function isInputDOMNode(event: KeyboardEvent): boolean { // using composed path for handling shadow dom