mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Don't show FormatBar if composer is empty
Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
parent
b368856f2b
commit
ed2eca52b2
1 changed files with 3 additions and 1 deletions
|
@ -359,6 +359,8 @@ export default class BasicMessageEditor extends React.Component {
|
|||
}
|
||||
|
||||
_onSelectionChange = () => {
|
||||
const {isEmpty} = this.props.model;
|
||||
|
||||
this._refreshLastCaretIfNeeded();
|
||||
const selection = document.getSelection();
|
||||
if (this._hasTextSelected && selection.isCollapsed) {
|
||||
|
@ -366,7 +368,7 @@ export default class BasicMessageEditor extends React.Component {
|
|||
if (this._formatBarRef) {
|
||||
this._formatBarRef.hide();
|
||||
}
|
||||
} else if (!selection.isCollapsed) {
|
||||
} else if (!selection.isCollapsed && !isEmpty) {
|
||||
this._hasTextSelected = true;
|
||||
if (this._formatBarRef) {
|
||||
const selectionRect = selection.getRangeAt(0).getBoundingClientRect();
|
||||
|
|
Loading…
Reference in a new issue