From 2bd112ca7cfddf0601556e17c4e6ea26ed843f86 Mon Sep 17 00:00:00 2001 From: thobyv-kismat Date: Thu, 26 Mar 2020 08:37:46 +0100 Subject: [PATCH] add delete support and to keyboard shortcuts --- src/Keyboard.ts | 1 + src/components/views/rooms/BasicMessageComposer.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Keyboard.ts b/src/Keyboard.ts index 817d0a0b97..23e2bbf0d6 100644 --- a/src/Keyboard.ts +++ b/src/Keyboard.ts @@ -22,6 +22,7 @@ export const Key = { PAGE_UP: "PageUp", PAGE_DOWN: "PageDown", BACKSPACE: "Backspace", + DELETE: "Delete", ARROW_UP: "ArrowUp", ARROW_DOWN: "ArrowDown", ARROW_LEFT: "ArrowLeft", diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index 8d46146e18..ab6a3b584d 100644 --- a/src/components/views/rooms/BasicMessageComposer.js +++ b/src/components/views/rooms/BasicMessageComposer.js @@ -447,7 +447,7 @@ export default class BasicMessageEditor extends React.Component { } else if (event.key === Key.TAB) { this._tabCompleteName(); handled = true; - } else if (event.key === Key.BACKSPACE) { + } else if (event.key === Key.BACKSPACE || Key.DELETE) { this._formatBarRef.hide(); } }