fix(ui): Prevent Command from triggering while a editable field has focus (#11254)

Resolves CMRC-909
This commit is contained in:
Kasper Fabricius Kristensen
2025-02-04 11:09:07 +01:00
committed by GitHub
parent f07af7b93c
commit 3cf4307296
3 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
const isInputElement = (element: Element | null): boolean => {
return (
element instanceof HTMLElement &&
(element.isContentEditable ||
element.tagName === "INPUT" ||
element.tagName === "TEXTAREA" ||
element.tagName === "SELECT")
)
}
export { isInputElement }