From c95b23f3ec3ca2567d73db981bcb1c1896a53529 Mon Sep 17 00:00:00 2001 From: thobyv-kismat Date: Tue, 24 Mar 2020 19:50:37 +0100 Subject: [PATCH 1/3] fix formatBar not hidden after highlight-backspacing text partially --- src/components/views/rooms/BasicMessageComposer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index 75455518a13..8d46146e181 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) { + this._formatBarRef.hide(); } } if (handled) { From 2bd112ca7cfddf0601556e17c4e6ea26ed843f86 Mon Sep 17 00:00:00 2001 From: thobyv-kismat Date: Thu, 26 Mar 2020 08:37:46 +0100 Subject: [PATCH 2/3] 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 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 8d46146e181..ab6a3b584d0 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(); } } From 1713006958becbbad6996bd403aa98ca70e4f5cd Mon Sep 17 00:00:00 2001 From: thobyv-kismat Date: Thu, 26 Mar 2020 14:03:38 +0100 Subject: [PATCH 3/3] recommit bwindels commited changes to refactor check logic after rebase mistake --- src/components/views/rooms/BasicMessageComposer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index ab6a3b584d0..df628233605 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 || Key.DELETE) { + } else if (event.key === Key.BACKSPACE || event.key === Key.DELETE) { this._formatBarRef.hide(); } }