@waveform-playlist/core 13.0.0-next.3 → 13.0.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -999,14 +999,17 @@ function keyBelongsToFocusedControl(event) {
|
|
|
999
999
|
if (ownsAllKeys(focused)) return true;
|
|
1000
1000
|
return activates(focused, event.key);
|
|
1001
1001
|
}
|
|
1002
|
+
var preventedByShortcut = /* @__PURE__ */ new WeakSet();
|
|
1002
1003
|
function handleKeyboardEvent(event, shortcuts, enabled) {
|
|
1003
1004
|
if (!enabled) return;
|
|
1004
1005
|
if (event.repeat) return;
|
|
1006
|
+
if (event.key === "Escape" && event.defaultPrevented && !preventedByShortcut.has(event)) return;
|
|
1005
1007
|
if (keyBelongsToFocusedControl(event)) return;
|
|
1006
1008
|
const matchingShortcut = shortcuts.find((shortcut) => matchesKeyBinding(event, shortcut));
|
|
1007
1009
|
if (matchingShortcut) {
|
|
1008
1010
|
if (matchingShortcut.preventDefault !== false) {
|
|
1009
1011
|
event.preventDefault();
|
|
1012
|
+
preventedByShortcut.add(event);
|
|
1010
1013
|
}
|
|
1011
1014
|
matchingShortcut.action();
|
|
1012
1015
|
}
|