mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 23:18:12 +08:00
Fix DropdownInput widget not reactively updating when its content changes (#2770)
* Improve reactivity of DropdownInput.svelte * Fix formatting lint --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
62c7f88f5b
commit
532e913017
@@ -30,6 +30,7 @@
|
||||
let open = false;
|
||||
|
||||
$: watchSelectedIndex(selectedIndex);
|
||||
$: watchEntries(entries);
|
||||
$: watchActiveEntry(activeEntry);
|
||||
$: watchOpen(open);
|
||||
|
||||
@@ -38,7 +39,13 @@
|
||||
}
|
||||
|
||||
// Called only when `selectedIndex` is changed from outside this component
|
||||
function watchSelectedIndex(_?: number) {
|
||||
function watchSelectedIndex(_?: typeof selectedIndex) {
|
||||
activeEntrySkipWatcher = true;
|
||||
activeEntry = makeActiveEntry();
|
||||
}
|
||||
|
||||
// Called only when `entries` is changed from outside this component
|
||||
function watchEntries(_?: typeof entries) {
|
||||
activeEntrySkipWatcher = true;
|
||||
activeEntry = makeActiveEntry();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user