From ccd351e66c8ffbb374fe5478658a6ee84289577a Mon Sep 17 00:00:00 2001 From: pupuis <46632529+pupuis@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:40:10 +0200 Subject: [PATCH] Bugfix: Delete button not working on feedback field etc. (inputs) (#532) --- frontend/components/Editor.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/components/Editor.js b/frontend/components/Editor.js index 15770aa4bd..c6c445a8af 100644 --- a/frontend/components/Editor.js +++ b/frontend/components/Editor.js @@ -677,6 +677,7 @@ export class Editor extends Component { const selected = this.state.notebook.cells.filter((c) => c.selected) if (selected.length > 0) { this.requests.confirm_delete_multiple(verb, selected) + return true } } @@ -695,15 +696,17 @@ export class Editor extends Component { } e.preventDefault() } else if (e.key === "Backspace" || e.key === "Delete") { - this.delete_selected("Delete") - e.preventDefault() + if(this.delete_selected("Delete")){ + e.preventDefault() + } + } else if ((e.key === "?" && has_ctrl_or_cmd_pressed(e)) || e.key === "F1") { // On mac "cmd+shift+?" is used by chrome, so that is why this needs to be ctrl as well on mac // Also pressing "ctrl+shift" on mac causes the key to show up as "/", this madness // I hope we can find a better solution for this later - Dral alert( `Shortcuts 🎹 - + Shift+Enter: run cell ${ctrl_or_cmd_name}+Enter: run cell and add cell below Delete or Backspace: delete empty cell