mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:35:04 +08:00
Merge pull request #2968 from npny/npny/autocomplete-prevent-send-on-enter
Hide autocomplete on Enter key press instead of sending message
This commit is contained in:
commit
e1d1c8f99c
@ -988,6 +988,12 @@ export default class MessageComposerInput extends React.Component {
|
|||||||
return change.insertText('\n');
|
return change.insertText('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.autocomplete.countCompletions() > 0) {
|
||||||
|
this.autocomplete.hide();
|
||||||
|
ev.preventDefault();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const editorState = this.state.editorState;
|
const editorState = this.state.editorState;
|
||||||
|
|
||||||
const lastBlock = editorState.blocks.last();
|
const lastBlock = editorState.blocks.last();
|
||||||
|
Loading…
Reference in New Issue
Block a user