|
|
@ -10,8 +10,8 @@ useTheme() |
|
|
|
useEventListener(document, 'keydown', async (e: KeyboardEvent) => { |
|
|
|
useEventListener(document, 'keydown', async (e: KeyboardEvent) => { |
|
|
|
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey |
|
|
|
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey |
|
|
|
if (cmdOrCtrl) { |
|
|
|
if (cmdOrCtrl) { |
|
|
|
switch (e.code) { |
|
|
|
switch (e.key.toLowerCase()) { |
|
|
|
case 'KeyA': |
|
|
|
case 'a': |
|
|
|
// prevent Ctrl + A selection for non-editable nodes |
|
|
|
// prevent Ctrl + A selection for non-editable nodes |
|
|
|
if (!['input', 'textarea'].includes((e.target as any).nodeName.toLowerCase())) { |
|
|
|
if (!['input', 'textarea'].includes((e.target as any).nodeName.toLowerCase())) { |
|
|
|
e.preventDefault() |
|
|
|
e.preventDefault() |
|
|
|