@cosxai/ui 0.18.0 → 0.18.1
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/package.json
CHANGED
|
@@ -60,11 +60,17 @@ export function useKeyboardHotkey(
|
|
|
60
60
|
if (skipInputs) {
|
|
61
61
|
const ae = document.activeElement as HTMLElement | null;
|
|
62
62
|
const tag = ae?.tagName;
|
|
63
|
+
// Containers marked data-hotkey-passthrough host editables
|
|
64
|
+
// the user never types into (e.g. a canvas spreadsheet's
|
|
65
|
+
// hidden cell-editor focus trap) — hotkeys stay live there.
|
|
66
|
+
// Mirrors the same convention in consumer apps.
|
|
67
|
+
const passthrough = !!ae?.closest?.('[data-hotkey-passthrough="true"]');
|
|
63
68
|
if (
|
|
64
|
-
|
|
65
|
-
tag === "
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
!passthrough &&
|
|
70
|
+
(tag === "INPUT" ||
|
|
71
|
+
tag === "TEXTAREA" ||
|
|
72
|
+
tag === "SELECT" ||
|
|
73
|
+
ae?.isContentEditable)
|
|
68
74
|
) {
|
|
69
75
|
return;
|
|
70
76
|
}
|