diff --git a/registry/lib/components/utils/keymap/bindings.ts b/registry/lib/components/utils/keymap/bindings.ts index 113bb6c0c..e8a8f40c2 100644 --- a/registry/lib/components/utils/keymap/bindings.ts +++ b/registry/lib/components/utils/keymap/bindings.ts @@ -46,9 +46,16 @@ export const loadKeyBindings = lodash.once((bindings: KeyBinding[]) => { } // 忽略其他可聚焦元素 - const hasElementFocus = !([document.body, null] as (Element | null)[]).includes( - getActiveElement(), - ) + const hasElementFocus = (() => { + const activeElement = getActiveElement() + if (([document.body, null] as (Element | null)[]).includes(activeElement)) { + return false + } + if (activeElement instanceof HTMLMediaElement) { + return false + } + return true + })() if ( (binding.action.ignoreFocus !== false || binding.action.ignoreTyping !== false) && hasElementFocus