mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-16 13:51:32 +03:00
refocus editor after clicking on autocompletes
This commit is contained in:
parent
7de45f8b7b
commit
11cea61661
1 changed files with 6 additions and 3 deletions
|
@ -1313,7 +1313,8 @@ export default class MessageComposerInput extends React.Component {
|
|||
if (range) {
|
||||
const change = editorState.change()
|
||||
.collapseToAnchor()
|
||||
.moveOffsetsTo(range.start, range.end);
|
||||
.moveOffsetsTo(range.start, range.end)
|
||||
.focus();
|
||||
editorState = change.value;
|
||||
}
|
||||
|
||||
|
@ -1321,12 +1322,14 @@ export default class MessageComposerInput extends React.Component {
|
|||
if (inline) {
|
||||
change = editorState.change()
|
||||
.insertInlineAtRange(editorState.selection, inline)
|
||||
.insertText(suffix);
|
||||
.insertText(suffix)
|
||||
.focus();
|
||||
}
|
||||
else {
|
||||
change = editorState.change()
|
||||
.insertTextAtRange(editorState.selection, completion)
|
||||
.insertText(suffix);
|
||||
.insertText(suffix)
|
||||
.focus();
|
||||
}
|
||||
editorState = change.value;
|
||||
|
||||
|
|
Loading…
Reference in a new issue