Represents a Dropdown component.

Slots
target — Renders the dropdown's target element.
default — Renders the dropdown list items.
CSS Parts
base — The dropdown list wrapper container.
list — The dropdown list element.

The distance from the target element.

distance: number

Whether the component should be flipped to the opposite side of the target once it's about to overflow the visible area. When true, once enough space is detected on its preferred side, it will flip back.

flip: boolean

The preferred placement of the component around the target element.

placement: PopoverPlacement

Whether the dropdown's width should be the same as the target's one.

sameWidth: boolean

Returns the group items of the dropdown.

get groups(): IgrDropdownGroupComponent[]

Returns IgrDropdownGroupComponent[]

Returns the items of the dropdown.

get items(): IgrDropdownItemComponent[]

Returns IgrDropdownItemComponent[]

Returns the selected item from the dropdown or null.

get selectedItem(): IgrDropdownItemComponent | null

Returns IgrDropdownItemComponent | null

Clears the current selection of the dropdown.

clearSelection(): void

Returns void

Navigates to the item with the specified value. If it exists, returns the found item, otherwise - null.

navigateTo(value: string): IgrDropdownItemComponent | null

Parameters

  • value: string

Returns IgrDropdownItemComponent | null

Selects the item with the specified value. If it exists, returns the found item, otherwise - null.

select(value: string): IgrDropdownItemComponent | null

Parameters

  • value: string

Returns IgrDropdownItemComponent | null

Shows the component.

show(target: string | HTMLElement): Promise<boolean>

Parameters

  • target: string | HTMLElement

Returns Promise<boolean>

Toggles the open state of the component.

toggle(target: string | HTMLElement): Promise<boolean>

Parameters

  • target: string | HTMLElement

Returns Promise<boolean>

Emitted when the selected item changes.

onChange(args: CustomEvent<IgrDropdownItemComponent>): void

Parameters

Returns void

Emitted after closing the dropdown.

onClosed(args: CustomEvent<void>): void

Parameters

Returns void

Emitted just before the dropdown is closed.

onClosing(args: CustomEvent<void>): void

Parameters

Returns void

Emitted after the dropdown is opened.

onOpened(args: CustomEvent<void>): void

Parameters

Returns void

Emitted just before the dropdown is opened.

onOpening(args: CustomEvent<void>): void

Parameters

Returns void