mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 07:46:30 +01:00
Automatically trigger autocomplete on focus.
This commit is contained in:
@@ -84,6 +84,13 @@ export default class EmptyTypeWidget extends TypeWidget {
|
||||
);
|
||||
}
|
||||
|
||||
// Automatically trigger autocomplete on focus.
|
||||
this.$autoComplete.on('focus', () => {
|
||||
// simulate pressing down arrow to trigger autocomplete
|
||||
this.$autoComplete.trigger($.Event('keydown', { which: 40 })); // arrow down
|
||||
this.$autoComplete.trigger($.Event('keydown', { which: 38 })); // arrow up
|
||||
});
|
||||
|
||||
this.$autoComplete
|
||||
.trigger('focus')
|
||||
.trigger('select');
|
||||
|
||||
Reference in New Issue
Block a user