Bugfix for wrong toggle buttons behavior in Issues (#2299)

Signed-off-by: muhtimur <timur.mukhamedishin@xored.com>
This commit is contained in:
Timur Mukhamedishin 2022-10-12 20:16:33 +07:00 committed by GitHub
parent 507b155441
commit 3d4045c7c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,17 +12,19 @@
<div class="antiCard">
<div class="antiCard-group grid">
{#each config as model}
{@const value = viewOptions[model.key]}
<span class="label"><Label label={model.label} /></span>
<div class="value">
{#if isToggleType(model)}
<MiniToggle on={value} on:change={() => dispatch('update', { key: model.key, value: !value })} />
<MiniToggle
on={viewOptions[model.key]}
on:change={() => dispatch('update', { key: model.key, value: !viewOptions[model.key] })}
/>
{:else if isDropdownType(model)}
{@const items = model.values.filter(({ hidden }) => !hidden?.(viewOptions))}
<DropdownLabelsIntl
label={model.label}
{items}
selected={value}
selected={viewOptions[model.key]}
width="10rem"
justify="left"
on:selected={(e) => dispatch('update', { key: model.key, value: e.detail })}