Skip to content

Commit

Permalink
Fix reactivity for custom features. #11
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Apr 17, 2024
1 parent a2002e6 commit c4db0e5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/routes/cross_section/proposed/CustomFeatures.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@

<SecondaryButton on:click={add}>Add</SecondaryButton>

{#each Object.entries($state.proposed.customFeatures) as [id, feature] (id)}
{#each Object.keys($state.proposed.customFeatures) as id (id)}
<div style="display: flex; justify-content: space-between">
<TextInput label="Name" bind:value={feature.name} />
<TextInput
label="Name"
bind:value={$state.proposed.customFeatures[id].name}
/>
<NumberInput
label="Minimum width (m)"
width={3}
min={0}
bind:value={feature.width}
bind:value={$state.proposed.customFeatures[id].width}
/>
<WarningButton on:click={() => deleteFeature(id)}>Delete</WarningButton>
</div>
Expand Down

0 comments on commit c4db0e5

Please sign in to comment.