Remove two possible sources for the "AutoComplete stays visible bug
which is now https://github.com/vector-im/riot-web/issues/4537 <- there. This does two things: - Track which query was the most recent one requesting completion and only process completions for that one. (In this case the empty string "" doesn't have any completions but we still track it so that previous calls with non-empty queries would not race and cause completions to be shown when we actuall don't want any.) - Make the "do we want to show the AutoComplete box?" logic a bit more sane
This commit is contained in:
parent
e970b68859
commit
7a8f524f4a
2 changed files with 18 additions and 14 deletions
|
@ -514,6 +514,7 @@ export default class MessageComposerInput extends React.Component {
|
|||
const currentBlockType = RichUtils.getCurrentBlockType(this.state.editorState);
|
||||
// If we're in any of these three types of blocks, shift enter should insert soft newlines
|
||||
// And just enter should end the block
|
||||
// XXX: Empirically enter does not end these blocks
|
||||
if(['blockquote', 'unordered-list-item', 'ordered-list-item'].includes(currentBlockType)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -629,8 +630,6 @@ export default class MessageComposerInput extends React.Component {
|
|||
editorState: this.createEditorState(),
|
||||
});
|
||||
|
||||
this.autocomplete.hide();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue