diff --git a/src/Keyboard.ts b/src/Keyboard.ts index 817d0a0b973..23e2bbf0d68 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 75455518a13..df628233605 100644 --- a/src/components/views/rooms/BasicMessageComposer.js +++ b/src/components/views/rooms/BasicMessageComposer.js @@ -447,6 +447,8 @@ export default class BasicMessageEditor extends React.Component { } else if (event.key === Key.TAB) { this._tabCompleteName(); handled = true; + } else if (event.key === Key.BACKSPACE || event.key === Key.DELETE) { + this._formatBarRef.hide(); } } if (handled) {