Skip to content

Commit

Permalink
improve keyboard inputs on input chip
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslounds committed Feb 19, 2023
1 parent 3b7a861 commit b52d369
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/components/InputChip/InputChip.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
// Props (styles)
/** Provide classes or a variant to style the chips. */
export let chips: CssClasses = 'variant-filled';
export let chips: CssClasses = 'variant-filled focus:variant-outline-primary';
/** Provide classes used to indicate invalid state. */
export let invalid: CssClasses = 'input-error';
/** Provide classes to set padding styles. */
Expand Down Expand Up @@ -117,7 +117,7 @@
<div class="input-chip {classesBase}" class:opacity-50={$$restProps.disabled}>
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
<div class="h-0 overflow-hidden">
<select bind:value {name} multiple {required}>
<select bind:value {name} multiple {required} tabindex="-1">
<!-- NOTE: options are required! -->
{#each value as option}<option value={option}>{option}</option>{/each}
</select>
Expand All @@ -142,7 +142,7 @@
{#each value as c, i (c)}
<!-- Wrapping div required for FLIP animation -->
<div animate:flip={{ duration }}>
<span
<button
class="chip {chips}"
on:click={(e) => {
removeChip(e, i, c);
Expand All @@ -155,7 +155,7 @@
>
<span>{c}</span>
<span>✕</span>
</span>
</button>
</div>
{/each}
</div>
Expand Down

0 comments on commit b52d369

Please sign in to comment.