Releases: metonym/svelte-typeahead
Releases · metonym/svelte-typeahead
v4.2.1
Fixes
- prevent keyboard selection and navigation of disabled results
- add missing annotation for
TItem.disabled
toresults
prop
Documentation
- add
pnpm
installation command - remove "disabling items after selection" example
- remove
id
fields fromdata
array - simplify dispatched events example
v4.2.0
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
v4.0.0
v3.0.0
v2.4.1
v2.4.0
v2.3.0
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
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); }}" />