Fix to preventDefault on all key bindings (#3075)
This commit is contained in:
@ -65,6 +65,7 @@ export default class CodeManager {
|
||||
this._hotkeys[key]()
|
||||
return false
|
||||
},
|
||||
preventDefault: true,
|
||||
}))
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,9 @@ export default function useHotkeyWrapper(
|
||||
callback: () => void,
|
||||
additionalOptions?: Options
|
||||
) {
|
||||
useHotkeys(hotkey, callback, additionalOptions)
|
||||
const defaultOptions = { preventDefault: true }
|
||||
const options = { ...defaultOptions, ...additionalOptions }
|
||||
useHotkeys(hotkey, callback, options)
|
||||
useEffect(() => {
|
||||
for (const key of hotkey) {
|
||||
const keybinding = mapHotkeyToCodeMirrorHotkey(key)
|
||||
|
Reference in New Issue
Block a user