Skip to content

Commit

Permalink
Merge pull request #460 from matt8707/number
Browse files Browse the repository at this point in the history
Fix set input number when mode is auto, close #442
  • Loading branch information
matt8707 authored May 11, 2024
2 parents 25575a2 + 4423a9e commit c27033b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/lib/Modal/InputNumberModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,17 @@
</span>
</h2>

{#if entity && entity?.attributes?.mode === 'slider'}
{#if entity && entity?.attributes?.mode === 'box'}
<input
class="input"
type="number"
value={Number(entity?.state)}
min={entity?.attributes?.min}
max={entity?.attributes?.max}
step={entity?.attributes?.step}
on:change={handleInputBox}
/>
{:else}
<RangeSlider
{value}
min={entity?.attributes?.min}
Expand All @@ -102,16 +112,6 @@
handleChange(event?.detail);
}}
/>
{:else if entity && entity?.attributes?.mode === 'box'}
<input
class="input"
type="number"
value={Number(entity?.state)}
min={entity?.attributes?.min}
max={entity?.attributes?.max}
step={entity?.attributes?.step}
on:change={handleInputBox}
/>
{/if}

{#if errorMessage}
Expand Down

0 comments on commit c27033b

Please sign in to comment.