mirror of
https://github.com/vector-im/element-web.git
synced 2025-12-12 21:01:15 +01:00
Merge pull request #4130 from matrix-org/travis/fix-tab-complete
Don't print errors when the tab is used with no autocomplete present
This commit is contained in:
commit
28c5641180
@ -471,10 +471,14 @@ export default class BasicMessageEditor extends React.Component {
|
|||||||
const addedLen = range.replace([partCreator.pillCandidate(range.text)]);
|
const addedLen = range.replace([partCreator.pillCandidate(range.text)]);
|
||||||
return model.positionForOffset(caret.offset + addedLen, true);
|
return model.positionForOffset(caret.offset + addedLen, true);
|
||||||
});
|
});
|
||||||
await model.autoComplete.onTab();
|
|
||||||
if (!model.autoComplete.hasSelection()) {
|
// Don't try to do things with the autocomplete if there is none shown
|
||||||
this.setState({showVisualBell: true});
|
if (model.autoComplete) {
|
||||||
model.autoComplete.close();
|
await model.autoComplete.onTab();
|
||||||
|
if (!model.autoComplete.hasSelection()) {
|
||||||
|
this.setState({showVisualBell: true});
|
||||||
|
model.autoComplete.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user