Skip to content

Commit

Permalink
fix(Input): error color now shows for leading
Browse files Browse the repository at this point in the history
fix(DatePicker): error color now shows for leading
fix(InputNumber): error color now shows for leading
  • Loading branch information
N00nDay committed Apr 9, 2023
1 parent e809f08 commit 0c6ac9d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/components/datepicker/DateInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@
{/if}

{#if $$slots.leading}
<span class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<span
class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"
class:text-danger={error}
>
<slot name="leading" />
</span>
{/if}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/components/input-number/InputNumber.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
{autocomplete}
{name}
{readonly}
{disabled}
id={name}
class="block w-full h-[2.5rem] px-3 border outline-none focus:outline-none sm:text-sm rounded-md bg-surface placeholder-secondary-content placeholder-opacity-80"
class:border-red-400={error}
Expand All @@ -70,6 +71,7 @@
{#if $$slots.leading}
<span
class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-secondary-content"
class:text-danger={error}
>
<slot name="leading" />
</span>
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/input/Input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
{#if $$slots.leading}
<span
class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-secondary-content"
class:text-danger={error}
>
<slot name="leading" />
</span>
Expand Down

0 comments on commit 0c6ac9d

Please sign in to comment.