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

Determines the behavior of the component during scrolling of the parent container.

scrollStrategy: PopoverScrollStrategy

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

Returns IgrDropdownItemComponent

Clears the current selection of the dropdown.

clearSelection(): void

Returns void

Invoked when the component is removed from the document's DOM.

This callback is the main signal to the element that it may no longer be used. disconnectedCallback() should ensure that nothing is holding a reference to the element (such as event listeners added to nodes external to the element), so that it is free to be garbage collected.

``

An element may be re-connected after being disconnected.

disconnectedCallback(): void

Returns void

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

navigateTo(value: string): IgrDropdownItemComponent

Parameters

  • value: string

Returns IgrDropdownItemComponent

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

select(value: string): IgrDropdownItemComponent

Parameters

  • value: string

Returns IgrDropdownItemComponent

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

Emitter just before the dropdown is closed.

onClosing(args: CustomEvent<void>): void

Parameters

Returns void

Emitted after the dropdown is open.

onOpened(args: CustomEvent<void>): void

Parameters

Returns void

Emitted just before the dropdown is open.

onOpening(args: CustomEvent<void>): void

Parameters

Returns void