port tab completion from MessageComposerInput

pull/21833/head
Bruno Windels 2019-05-24 12:38:01 +02:00
parent 3468cef654
commit a024fd8991
1 changed files with 18 additions and 2 deletions

View File

@ -39,8 +39,24 @@ export default class AutocompleteWrapperModel {
this._updateCallback({close: true}); this._updateCallback({close: true});
} }
onTab() { async onTab(e) {
//forceCompletion here? const acComponent = this._getAutocompleterComponent();
if (acComponent.state.completionList.length === 0) {
// Force completions to show for the text currently entered
await acComponent.forceComplete();
// Select the first item by moving "down"
await acComponent.onDownArrow();
} else {
if (e.shiftKey) {
await acComponent.onUpArrow();
} else {
await acComponent.onDownArrow();
}
}
this._updateCallback({
close: true,
});
} }
onUpArrow() { onUpArrow() {