Represents a control that provides a menu of options.
- Slots
-
default— Renders the list of select items. -
prefix— Renders content before the input. -
suffix— Renders content after the input. -
header— Renders a container before the list of options. -
footer— Renders a container after the list of options. -
helper-text— Renders content below the input. -
toggle-icon— Renders content that replaces the default toggle icon. -
toggle-icon-expanded— Renders content for the toggle icon when the component is in open state. -
value-missing— Renders content when the required validation fails. -
custom-error— Renders content when setCustomValidity(message) is set. -
invalid— Renders content when the component is in invalid state (validity.valid = false).
- CSS Parts
-
base— The popup container of the list of options. -
list— The list wrapping container for the items of the select. -
input— The encapsulated input of the select. -
native-input— The native input element of the encapsulated input. -
label— The encapsulated text label of the select. -
prefix— The prefix wrapper of the input of the select. -
suffix— The suffix wrapper of the input of the select. -
toggle-icon— The toggle icon wrapper of the select. -
filled— Added to the toggle-icon part when the select has a value. -
helper-text— The helper text wrapper of the select.
Properties
Section titled "Properties"autofocus
Section titled "autofocus"Whether the control takes the focus after its first render.
autofocus: boolean distance
Section titled "distance"The distance of the select dropdown from its input.
distance: number keepOpenOnOutsideClick
Section titled "keepOpenOnOutsideClick"Whether the component stays open when the user clicks outside of it.
keepOpenOnOutsideClick: boolean keepOpenOnSelect
Section titled "keepOpenOnSelect"Whether the component stays open after the user selects an item.
keepOpenOnSelect: boolean outlined
Section titled "outlined"Whether the control has an outlined appearance.
outlined: boolean placement
Section titled "placement"The preferred placement of the select dropdown around its input.
placement: PopoverPlacement scrollStrategy
Section titled "scrollStrategy"The behavior of the component when a parent container scrolls.
If the value is hide, the component hides while the anchor is fully out
of view. hide is the default value.
If the value is scroll, the component stays visible and anchored.
If the value is close, the component closes on each scroll.
scrollStrategy: PopoverScrollStrategy Accessors
Section titled "Accessors"groups
Section titled "groups"Returns the groups of the select component.
get groups(): IgrSelectGroupComponent[]
Returns IgrSelectGroupComponent[]
items
Section titled "items"Returns the items of the select component.
get items(): IgrSelectItemComponent[]
Returns IgrSelectItemComponent[]
selectedItem
Section titled "selectedItem"Returns the selected item from the dropdown or null.
get selectedItem(): IgrSelectItemComponent | null
Returns IgrSelectItemComponent | null
Methods
Section titled "Methods"Removes focus from the component.
blur(): void Returns void
clearSelection
Section titled "clearSelection"Resets the current value and selection of the component.
clearSelection(): void Returns void
focus
Section titled "focus"Sets focus on the component.
focus(options: FocusOptions): void Parameters
- options:
FocusOptions
Returns void
Closes the component. It does not emit events. The promise resolves to
false when the component is already closed, or when a later call
replaces this one.
hide(): Promise<boolean> Returns Promise<boolean>
navigateTo
Section titled "navigateTo"Navigates to the item with the specified value. If it exists, returns the found item, otherwise - null.
navigateTo(value: string): IgrSelectItemComponent | null Parameters
- value:
string
Returns IgrSelectItemComponent | null
select
Section titled "select"Selects the item with the specified value. If it exists, returns the found item, otherwise - null.
select(value: string): IgrSelectItemComponent | null Parameters
- value:
string
Returns IgrSelectItemComponent | null
Opens the component. It does not emit events. The promise resolves to
false when the component is already open, or when a later call replaces
this one.
show(): Promise<boolean> Returns Promise<boolean>
toggle
Section titled "toggle"Opens the component when it is closed, and closes it when it is open. It
does not emit events. The promise resolves to true when the state
changes.
toggle(): Promise<boolean> Returns Promise<boolean>
Events
Section titled "Events"onChange
Section titled "onChange"Emitted when the user selects a different item. The detail is the item.
onChange(args: CustomEvent<IgrSelectItemComponent>): void Parameters
- args:
CustomEvent<IgrSelectItemComponent>
Returns void
onClosed
Section titled "onClosed"Emitted after the list of options closes on a user action.
onClosed(args: CustomEvent<void>): void Parameters
- args:
CustomEvent<void>
Returns void
onClosing
Section titled "onClosing"Emitted before the user closes the list of options. Cancelable.
onClosing(args: CustomEvent<void>): void Parameters
- args:
CustomEvent<void>
Returns void
onOpened
Section titled "onOpened"Emitted after the list of options opens on a user action.
onOpened(args: CustomEvent<void>): void Parameters
- args:
CustomEvent<void>
Returns void
onOpening
Section titled "onOpening"Emitted before the user opens the list of options. Cancelable.
onOpening(args: CustomEvent<void>): void Parameters
- args:
CustomEvent<void>