fix: pass value and let parent update children, handle updates through reactive block
This commit is contained in:
parent
8dff9ca919
commit
20a5604bf9
2 changed files with 13 additions and 6 deletions
|
@ -41,7 +41,7 @@
|
||||||
item={toplevel}
|
item={toplevel}
|
||||||
children={subtrees}
|
children={subtrees}
|
||||||
bind:selected={subSelections[i]}
|
bind:selected={subSelections[i]}
|
||||||
bind:generalToggle
|
generalToggle={$generalToggle}
|
||||||
{initial}
|
{initial}
|
||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
|
|
|
@ -77,11 +77,18 @@
|
||||||
dispatch('change', { value: evt.detail.value });
|
dispatch('change', { value: evt.detail.value });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (generalToggle) {
|
function handleGeneralToggleChange(value) {
|
||||||
generalToggle.subscribe(value => {
|
if (value) {
|
||||||
value ? filtering.setChecked() : filtering.setUnchecked();
|
filtering.setChecked();
|
||||||
dispatch('change', { value: $filtering });
|
} else {
|
||||||
});
|
filtering.setUnchecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
dispatch('change', { value: $filtering });
|
||||||
|
}
|
||||||
|
|
||||||
|
$: if (generalToggle != null) {
|
||||||
|
handleGeneralToggleChange(generalToggle);
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = (() => {
|
const url = (() => {
|
||||||
|
|
Loading…
Reference in a new issue