mirror of
https://github.com/zadam/trilium.git
synced 2026-03-13 11:53:38 +01:00
fix: address white space issue
This commit is contained in:
parent
ff203b9188
commit
a77323929c
@ -535,6 +535,7 @@ function initNoteAutocomplete($el: JQuery<HTMLElement>, options?: Options) {
|
||||
let shouldMirrorActiveItemToInput = false;
|
||||
let wasPanelOpen = false;
|
||||
let suppressNextClosedEmptyReset = false;
|
||||
let shouldClearQueryAfterClose = false;
|
||||
let suggestionRequestId = 0;
|
||||
|
||||
const clearCursor = () => {
|
||||
@ -659,12 +660,21 @@ function initNoteAutocomplete($el: JQuery<HTMLElement>, options?: Options) {
|
||||
} else if (!String(inputEl.value).trim()) {
|
||||
searchDelay = 0;
|
||||
resetSelectionState($el);
|
||||
currentQuery = "";
|
||||
inputEl.value = "";
|
||||
shouldClearQueryAfterClose = state.query.length > 0;
|
||||
$el.trigger("change");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (activeItem && shouldMirrorActiveItemToInput) {
|
||||
if (shouldClearQueryAfterClose) {
|
||||
inputEl.value = "";
|
||||
shouldClearQueryAfterClose = false;
|
||||
queueMicrotask(() => {
|
||||
autocomplete.setQuery("");
|
||||
});
|
||||
} else if (activeItem && shouldMirrorActiveItemToInput) {
|
||||
inputEl.value = getSuggestionInputValue(activeItem);
|
||||
} else {
|
||||
inputEl.value = state.query;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user