Merge pull request #4269 from ThobyV/thobyv/hide-formatBar-on-highlight-backspacing-message

Fix formatBar not hidden after highlight and backspacing some text
pull/21833/head
Bruno Windels 2020-03-26 13:19:06 +00:00 committed by GitHub
commit 053a5a5ff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -22,6 +22,7 @@ export const Key = {
PAGE_UP: "PageUp", PAGE_UP: "PageUp",
PAGE_DOWN: "PageDown", PAGE_DOWN: "PageDown",
BACKSPACE: "Backspace", BACKSPACE: "Backspace",
DELETE: "Delete",
ARROW_UP: "ArrowUp", ARROW_UP: "ArrowUp",
ARROW_DOWN: "ArrowDown", ARROW_DOWN: "ArrowDown",
ARROW_LEFT: "ArrowLeft", ARROW_LEFT: "ArrowLeft",

View File

@ -447,6 +447,8 @@ export default class BasicMessageEditor extends React.Component {
} else if (event.key === Key.TAB) { } else if (event.key === Key.TAB) {
this._tabCompleteName(); this._tabCompleteName();
handled = true; handled = true;
} else if (event.key === Key.BACKSPACE || event.key === Key.DELETE) {
this._formatBarRef.hide();
} }
} }
if (handled) { if (handled) {