You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
refocus editor after clicking on autocompletes
This commit is contained in:
@@ -1313,7 +1313,8 @@ export default class MessageComposerInput extends React.Component {
|
|||||||
if (range) {
|
if (range) {
|
||||||
const change = editorState.change()
|
const change = editorState.change()
|
||||||
.collapseToAnchor()
|
.collapseToAnchor()
|
||||||
.moveOffsetsTo(range.start, range.end);
|
.moveOffsetsTo(range.start, range.end)
|
||||||
|
.focus();
|
||||||
editorState = change.value;
|
editorState = change.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1321,12 +1322,14 @@ export default class MessageComposerInput extends React.Component {
|
|||||||
if (inline) {
|
if (inline) {
|
||||||
change = editorState.change()
|
change = editorState.change()
|
||||||
.insertInlineAtRange(editorState.selection, inline)
|
.insertInlineAtRange(editorState.selection, inline)
|
||||||
.insertText(suffix);
|
.insertText(suffix)
|
||||||
|
.focus();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
change = editorState.change()
|
change = editorState.change()
|
||||||
.insertTextAtRange(editorState.selection, completion)
|
.insertTextAtRange(editorState.selection, completion)
|
||||||
.insertText(suffix);
|
.insertText(suffix)
|
||||||
|
.focus();
|
||||||
}
|
}
|
||||||
editorState = change.value;
|
editorState = change.value;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user