mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-10-27 11:35:23 -07:00
fix(sidebar): preserve Space playback after cue seeking (#247)
This commit is contained in:
1 parent
7c1eac03dc
commit
6841a37a22
7 files changed
+81
-3
No files matched your search
@@ -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: () => {},
|
||||
|
||||
Reference in new issue
Block a user