Skip to content

Releases: metonym/svelte-typeahead

v4.2.1

30 Oct 19:39
Compare
Choose a tag to compare

Fixes

  • prevent keyboard selection and navigation of disabled results
  • add missing annotation for TItem.disabled to results prop

Documentation

  • add pnpm installation command
  • remove "disabling items after selection" example
  • remove id fields from data array
  • simplify dispatched events example

v4.2.0

26 Oct 15:50
Compare
Choose a tag to compare

Features

  • use TypeScript generics so that the item type can be inferred from data value
<script lang="ts">
  import Typeahead from "svelte-typeahead";

  const data = [
    { id: 1, state: "North Carolina" },
    { id: 2, state: "North Dakota" },
    { id: 3, state: "South Carolina" },
    { id: 4, state: "South Dakota" },
  ];
</script>

<Typeahead
  {data}
  extract={(item) => {
    return item.state; // type "string" is inferred
  }}
/>

v4.1.0

03 Oct 19:46
Compare
Choose a tag to compare

Features

  • render a "no-results" slot when the search value does not yield results
  • add value to the default slot props

v4.0.0

05 Sep 19:06
Compare
Choose a tag to compare

Breaking Changes

  • use .svelte.d.ts for the component TypeScript definition extension

v3.0.0

16 Mar 12:47
Compare
Choose a tag to compare

Breaking Changes

  • the ul element is rendered even without results to preserve the accessibility label

Fixes

  • disable form ARIA attributes in svelte-search
  • pass the correct aria-activedescendant item to svelte-search

Contributed by @Skovvart in #20

v2.4.1

14 Mar 22:27
Compare
Choose a tag to compare

Fixes

  • pass id to Search to fix aria-labelledby references (contributed by @Skovvart in #19 )

v2.4.0

04 Mar 14:16
Compare
Choose a tag to compare

Features

  • add limit prop to limit number of results; default value is Infinity

    <Typeahead limit={2} {data} {extract} />

v2.3.0

21 Feb 13:51
Compare
Choose a tag to compare

Features

  • add disable, filter props to disable and filter items from the result set (contributed by @Amerlander)

Fixes

  • bind the input element reference correctly to fix focusing behavior
  • don't pass the Typeahead id to Search

v2.2.0

20 Feb 20:48
Compare
Choose a tag to compare

Features

  • add inputAfterSelect prop to allow user to preserve or clear the input field after selecting a result; possible values are "update" | "clear" | "keep" (default is "update")

  • add searched value to dispatched "select" event detail (e.detail.searched)

    <Typeahead
      inputAfterSelect="clear"
      on:select="{(e) => {
        console.log(e.detail.searched);
      }}"
    />

v2.1.0

20 Feb 14:18
Compare
Choose a tag to compare

Features

  • include original item and originalIndex in dispatched "select" event

    <Typeahead
      on:select="{(e) => {
        console.log(e.detail.original);
        console.log(e.detail.originalIndex);
      }}"
    />