diff --git a/src/components/modules/blockEvents.ts b/src/components/modules/blockEvents.ts index 7228798f8..b1e5f7637 100644 --- a/src/components/modules/blockEvents.ts +++ b/src/components/modules/blockEvents.ts @@ -60,7 +60,7 @@ export default class BlockEvents extends Module { * * @todo probably using "beforeInput" event would be better here */ - if (event.key === '/' && !event.ctrlKey && !event.metaKey) { + if (event.code === 'Slash' && !event.ctrlKey && !event.metaKey) { this.slashPressed(event); } @@ -252,14 +252,9 @@ export default class BlockEvents extends Module { return; } - /** - * The Toolbox will be opened with immediate focus on the Search input, - * and '/' will be added in the search input by default — we need to prevent it and add '/' manually - */ - event.preventDefault(); - this.Editor.Caret.insertContentAtCaretPosition('/'); - - this.activateToolbox(); + setTimeout(() => { + this.activateToolbox(); + }, 0); } /**