You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Force-hide autocomplete after sending message.
Fixes vector-im/vector-web#2128
This commit is contained in:
@@ -18,6 +18,7 @@ export default class Autocomplete extends React.Component {
|
|||||||
|
|
||||||
this.completionPromise = null;
|
this.completionPromise = null;
|
||||||
this.onConfirm = this.onConfirm.bind(this);
|
this.onConfirm = this.onConfirm.bind(this);
|
||||||
|
this.hide = this.hide.bind(this);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
// list of completionResults, each containing completions
|
// list of completionResults, each containing completions
|
||||||
@@ -137,6 +138,10 @@ export default class Autocomplete extends React.Component {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
// selectionOffset = 0, so we don't end up completing when autocomplete is hidden
|
// selectionOffset = 0, so we don't end up completing when autocomplete is hidden
|
||||||
|
this.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
hide() {
|
||||||
this.setState({hide: true, selectionOffset: 0});
|
this.setState({hide: true, selectionOffset: 0});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -567,6 +567,8 @@ export default class MessageComposerInput extends React.Component {
|
|||||||
editorState: this.createEditorState(),
|
editorState: this.createEditorState(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.autocomplete.hide();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user