Hide autocomplete on Enter key press instead of sending message

This commit is contained in:
Pierre Boyer 2019-05-14 13:44:01 +02:00
parent 201fef8b11
commit a62f68bd39

View file

@ -1046,6 +1046,12 @@ export default class MessageComposerInput extends React.Component {
return change.insertText('\n');
}
if (this.autocomplete.countCompletions() > 0) {
this.autocomplete.hide();
ev.preventDefault();
return true;
}
const editorState = this.state.editorState;
const lastBlock = editorState.blocks.last();