@darkwiiplayer/better-select
v3.1.1
Published
* `placeholder` Placeholder displayed when nothing is selected * `search-placeholder` Placeholder passed to the search input in the drop-down
Readme
Attributes
placeholderPlaceholder displayed when nothing is selectedsearch-placeholderPlaceholder passed to the search input in the drop-down
Slots
clear: Overrides the default "x" clear buttonloading: Hidden by default, shown instead of items whilepopulate()runsplaceholder: Only shown when nothing is selected (replaces attribute placeholder if present)top: Insert content at the top of the drop-downbelow-search: Insert content beltween the search box and item listbottom: Insert content at the bottom of the drop-down
Parts
clear: The slot containing the clear buttondisplay-text: The text representing the currently selected valuedisplay: The outer display box that is always showndrop-down: The dialog element that pops up when the list is openeditem: The individual selectable list itemsitem disabled: Any item corresponding to a disabled optionitem enabled: Any item correesponding to a not disabled option
list: The wrapper containing the itemsplaceholder: The slot containing the placeholder textsearch: The search input box
Hooks
populate(): If present, gets called after opening to populate the options listsearch(string): Called on search input to update the list of optionsmatch(string, element): Used bysearchto compare each option to the search string
Properties
closeSignal: (read-only) An AbortSignal that fires when the drop-down closes
Events
change: Fired whenever the value changes, even if via JavaScriptinput: Fired when the value is changed by selecting an option (afterchange)
