fix(library): globalThis setTimeout in modal (test env has no window)

This commit is contained in:
afiqzudinhadi 2026-08-05 19:12:23 +08:00
parent 83bf8323e2
commit eb6b3d25d0

View file

@ -58,7 +58,7 @@ export class CandidatePickerModal extends FuzzySuggestModal<PickerItem> {
// Obsidian's selectSuggestion() calls close() BEFORE onChooseItem(), so settling here // Obsidian's selectSuggestion() calls close() BEFORE onChooseItem(), so settling here
// synchronously would discard a real choice. Defer one tick: a choice made in the same // synchronously would discard a real choice. Defer one tick: a choice made in the same
// tick settles first and this becomes a no-op; a genuine dismissal settles as skip. // tick settles first and this becomes a no-op; a genuine dismissal settles as skip.
window.setTimeout(() => this.settle(null), 0); setTimeout(() => this.settle(null), 0);
this.contentEl.empty(); this.contentEl.empty();
} }