Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Force-hide autocomplete after sending message.
Browse files Browse the repository at this point in the history
  • Loading branch information
aviraldg committed Sep 21, 2016
1 parent a2904ad commit 4421742
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/views/rooms/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default class Autocomplete extends React.Component {

this.completionPromise = null;
this.onConfirm = this.onConfirm.bind(this);
this.hide = this.hide.bind(this);

this.state = {
// list of completionResults, each containing completions
Expand Down Expand Up @@ -137,6 +138,10 @@ export default class Autocomplete extends React.Component {
e.preventDefault();

// selectionOffset = 0, so we don't end up completing when autocomplete is hidden
this.hide();
}

hide() {
this.setState({hide: true, selectionOffset: 0});
}

Expand Down
2 changes: 2 additions & 0 deletions src/components/views/rooms/MessageComposerInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,8 @@ export default class MessageComposerInput extends React.Component {
editorState: this.createEditorState(),
});

this.autocomplete.hide();

return true;
}

Expand Down

0 comments on commit 4421742

Please sign in to comment.