Fix hotkeys (#1468)
* use hotkey using key instead of which (default) * remove shift from block formatting hotkeys * smartly exit formatting with backspace * set markdown to off by default * exit formatting with escape
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { ReactNode } from 'react';
|
||||
import FocusTrap from 'focus-trap-react';
|
||||
import isHotkey from 'is-hotkey';
|
||||
import { isKeyHotkey } from 'is-hotkey';
|
||||
import { Header, Menu, Scroll, config } from 'folds';
|
||||
|
||||
import * as css from './AutocompleteMenu.css';
|
||||
@@ -22,8 +22,8 @@ export function AutocompleteMenu({ headerContent, requestClose, children }: Auto
|
||||
returnFocusOnDeactivate: false,
|
||||
clickOutsideDeactivates: true,
|
||||
allowOutsideClick: true,
|
||||
isKeyForward: (evt: KeyboardEvent) => isHotkey('arrowdown', evt),
|
||||
isKeyBackward: (evt: KeyboardEvent) => isHotkey('arrowup', evt),
|
||||
isKeyForward: (evt: KeyboardEvent) => isKeyHotkey('arrowdown', evt),
|
||||
isKeyBackward: (evt: KeyboardEvent) => isKeyHotkey('arrowup', evt),
|
||||
}}
|
||||
>
|
||||
<Menu className={css.AutocompleteMenu}>
|
||||
|
||||
Reference in New Issue
Block a user