From 378e9de97cb22ce8dd22044aacaf602fe4c75ab1 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Wed, 2 Feb 2022 09:28:32 +0000 Subject: [PATCH] [FIX] web_editor: open the powerbox in mobile task-2751059 X-original-commit: 86b22141b9653bfad8d135af7f66ff9bc36084ba Part-of: odoo/odoo#88059 --- .../static/lib/odoo-editor/src/powerbox/Powerbox.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/web_editor/static/lib/odoo-editor/src/powerbox/Powerbox.js b/addons/web_editor/static/lib/odoo-editor/src/powerbox/Powerbox.js index 93572a7f808..a8523dc73e1 100644 --- a/addons/web_editor/static/lib/odoo-editor/src/powerbox/Powerbox.js +++ b/addons/web_editor/static/lib/odoo-editor/src/powerbox/Powerbox.js @@ -22,7 +22,7 @@ export class Powerbox { this.el.style.width = `${this.options.width}px`; document.body.append(this.el); - this.addKeydownTrigger('/', { commands: this.options.commands }); + this.addHotKey('/', { commands: this.options.commands }); this._mainWrapperElement = document.createElement('div'); this._mainWrapperElement.className = 'oe-commandbar-mainWrapper'; @@ -140,14 +140,14 @@ export class Powerbox { this._resetPosition(); } - addKeydownTrigger(triggerKey, options) { + addHotKey(triggerKey, options) { this.options.editable.addEventListener( - 'keydown', + 'input', ev => { const selection = this.options.document.getSelection(); if (!selection.isCollapsed || !selection.rangeCount) return; if ( - ev.key === triggerKey && + ev.data === triggerKey && !this._active && (!this.options.shouldActivate || this.options.shouldActivate()) ) {