fix "show recent note" button, closes #3051

This commit is contained in:
zadam 2022-08-09 21:49:37 +02:00
parent 6dee1f38f7
commit 201ef7fcd5
3 changed files with 8 additions and 5 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "trilium",
"version": "0.54.0-beta",
"version": "0.54.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "trilium",
"version": "0.54.0-beta",
"version": "0.54.2",
"hasInstallScript": true,
"license": "AGPL-3.0-only",
"dependencies": {

View File

@ -5,7 +5,7 @@ import noteCreateService from './note_create.js';
import treeService from './tree.js';
import froca from "./froca.js";
// this key needs to have this value so it's hit by the tooltip
// this key needs to have this value, so it's hit by the tooltip
const SELECTED_NOTE_PATH_KEY = "data-note-path";
const SELECTED_EXTERNAL_LINK_KEY = "data-external-link";
@ -89,6 +89,11 @@ function showRecentNotes($el) {
$el.setSelectedNotePath("");
$el.autocomplete("val", "");
$el.trigger('focus');
// simulate pressing down arrow to trigger autocomplete
const e = $.Event('keydown');
e.which = 40; // arrow down
$el.trigger(e);
}
function initNoteAutocomplete($el, options) {

View File

@ -63,8 +63,6 @@ export default class EmptyTypeWidget extends TypeWidget {
appContext.tabManager.getActiveContext().setNote(suggestion.notePath);
});
noteAutocompleteService.showRecentNotes(this.$autoComplete);
this.$workspaceNotes = this.$widget.find('.workspace-notes');
super.doRender();