diff --git a/packages/vidstack/src/core/keyboard/controller.ts b/packages/vidstack/src/core/keyboard/controller.ts index bea1a0c3f..a5cc7d628 100644 --- a/packages/vidstack/src/core/keyboard/controller.ts +++ b/packages/vidstack/src/core/keyboard/controller.ts @@ -141,7 +141,7 @@ export class MediaKeyboardController extends MediaPlayerController { return; } - if (!method && isNumberPress) { + if (!method && isNumberPress && !modifierKeyPressed(event)) { event.preventDefault(); event.stopPropagation(); this.#media.remote.seek((this.$state.duration() / 10) * Number(event.key), event); @@ -288,3 +288,12 @@ const SYMBOL_KEY_MAP = ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')']; function replaceSymbolKeys(key: string) { return key.replace(/Shift\+(\d)/g, (_, num) => SYMBOL_KEY_MAP[num - 1]); } + +function modifierKeyPressed(event: KeyboardEvent) { + for (const key of MODIFIER_KEYS) { + if (event[key.toLowerCase() + 'Key']) { + return true; + } + } + return false; +}