v5 is a major release that that includes some
Updated in 5.0.0-beta.39
on:change
event fires when the user selects an option.
on:input
event fires when the value has been changed.
Removed getOptionLabel
, getGroupHeaderLabel
and noOptionsMessage
.
Removed Selection
, ChevronIcon
, ClearIcon
, LoadingIcon
, Icon
, List
and Item
components. Please use named slots instead:
<Select bind:items bind:value>
<div slot="prepend" />
<div slot="selection" let:selection />
<div slot="clear-icon" />
<div slot="multi-clear-icon" />
<div slot="loading-icon" />
<div slot="chevron-icon" />
<div slot="list" let:filteredItems />
<div slot="item" let:item let:index />
<div slot="empty" />
</Select>
You can use named slots to achieve the same results, with more flexibility. Example at svelte-select-examples
Removed isCreatable
prop and itemCreated
event, named slots can be used to build your own create method.
Example at svelte-select-examples
CSS classes and custom properties changed (only depreciated, no need to update if upgrading from v4) from camel to kebab case. For example selectedItem
→ selected-item
and --borderRadius
→ --border-radius
The following CSS custom properties were removed in v5.
--clearSelectColor
--clearSelectFocusColor
--clearSelectHoverColor
--groupTitleTextTransform
--indicatorColor
--indicatorFill
--indicatorHeight
--listLeft
--listRight
--multiClearBG
--multiClearFill
--multiClearHeight
--multiClearHoverBG
--multiClearHoverFill
--multiClearPadding
--multiClearRadius
--multiClearTextAlign
--multiClearTop
--multiClearWidth
--multiItemActiveBG
--multiItemActiveColor
--spinnerLeft
--spinnerRight
--virtualListHeight
selectContainer
→ svelte-select
listContainer
→ svelte-select-list
indicator
→ chevron
--clear-icon-colour
→ --clear-icon-color
virtual-list
removed
containerClasses
→ class
MultiSelection
→ Multi
indicatorSvg
→ ChevronIcon
showIndicator
→ showChevron
loadOptionsInterval
→ debounceWait
isMulti
→ multiple
isWaiting
→ loading
isClearable
→ clearable
isFocused
→ focused
isGroupHeaderSelectable
→ groupHeaderSelectable
isDisabled
→ disabled
isSearchable
→ searchable
labelIdentifier
-> label
optionIdentifier
-> itemId
selectedValue
removed (was already deprecated in v4 in favour of value
)