fix(sidebar): preserve Space playback after cue seeking (#247)

This commit is contained in:
sudacode authored and GitHub committed 2026-09-15 21:35:10 -07:00
1 parent 7c1eac03dc
commit 6841a37a22
7 files changed
+81 -3

No files matched your search

+13 -1
View File
@@ -375,7 +375,7 @@ test('subtitle sidebar modal opens from snapshot and clicking cue seeks playback
}
});
test('subtitle sidebar rows support keyboard activation', async () => {
test('subtitle sidebar rows seek with Enter and leave Space to playback shortcuts', async () => {
const globals = globalThis as typeof globalThis & { window?: unknown; document?: unknown };
const previousWindow = globals.window;
const previousDocument = globals.document;
@@ -471,6 +471,18 @@ test('subtitle sidebar rows support keyboard activation', async () => {
const keydownListeners = firstRow.listeners.get('keydown') ?? [];
assert.equal(keydownListeners.length > 0, true);
mpvCommands.length = 0;
let spacePrevented = false;
keydownListeners[0]!({
key: ' ',
preventDefault: () => {
spacePrevented = true;
},
});
assert.deepEqual(mpvCommands, []);
assert.equal(spacePrevented, false);
keydownListeners[0]!({
key: 'Enter',
preventDefault: () => {},