saas-js/saas-ui

Bug: useHotkeys and multiple pressings with special keys will make a stuck normal hotkey

tani-shi opened this issue · 3 comments

Description

When I do pressing multiple times a some key with keeping pressing a special key (e.g. cmd + z), normal hotkey (e.g. ArrowUp, ArrowDown) will be stuck and not working.

export const appHotkeys = {
...
      undo: {
        label: 'table.undo',
        command: platformSelect({ mac: '⌘ Z' }, 'Ctrl+Z'),
      },
...
} satisfies HotkeysConfig
useHotkeys(
    [
      'ArrowUp',
      '⇧ ArrowUp',
      'ArrowDown',
      '⇧ ArrowDown',
      'ArrowLeft',
      '⇧ ArrowLeft',
      'ArrowRight',
      '⇧ ArrowRight',
    ],
    (e) => {
    // won't be fired
    },
    [...]
)

Link to Reproduction

No response

Steps to reproduce

  1. Define a hotkey with cmd+z (undo) to hotkeys.ts
  2. Implement useHotkeysShortcut for hooking undo command
  3. Implement useHotkeys for hooking ArrowUp/ArrowDown
  4. Undo multiple times with keeping pressing cmd key
  5. Press ArrowUp or ArrowDown will be not working

Saas UI Version

2.6.2

Chakra UI Version

No response

Browser

No response

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response

Thanks for reporting, will investigate asap.

Fixed in 2.8.2