mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-13 02:30:29 +03:00
Make hotkeys work again (#1819)
This commit is contained in:
parent
c52c4f7d32
commit
c4abe39375
40 changed files with 182 additions and 39 deletions
|
|
@ -4,7 +4,7 @@ import { isKeyHotkey } from 'is-hotkey';
|
|||
import { Header, Menu, Scroll, config } from 'folds';
|
||||
|
||||
import * as css from './AutocompleteMenu.css';
|
||||
import { preventScrollWithArrowKey } from '../../../utils/keyboard';
|
||||
import { preventScrollWithArrowKey, stopPropagation } from '../../../utils/keyboard';
|
||||
|
||||
type AutocompleteMenuProps = {
|
||||
requestClose: () => void;
|
||||
|
|
@ -24,6 +24,7 @@ export function AutocompleteMenu({ headerContent, requestClose, children }: Auto
|
|||
allowOutsideClick: true,
|
||||
isKeyForward: (evt: KeyboardEvent) => isKeyHotkey('arrowdown', evt),
|
||||
isKeyBackward: (evt: KeyboardEvent) => isKeyHotkey('arrowup', evt),
|
||||
escapeDeactivates: stopPropagation,
|
||||
}}
|
||||
>
|
||||
<Menu className={css.AutocompleteMenu}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue