Skip to content

SuggestModalChooser.forceSetSelectedItem method

SuggestModalChooser › forceSetSelectedItem

Unofficial

Set the selected item by index, scrolling it into view unless a non-keyboard event triggered the change.

Signature:

forceSetSelectedItem(index: number, evt?: MouseEvent | KeyboardEvent | null | undefined): void

Parameters:

ParameterTypeDescription
indexnumberIndex of the item to select.
evt?MouseEvent | KeyboardEvent | null | undefinedThe triggering event, or null / omitted to always scroll the selected item into view.

Returns: void

Remarks:

Prefer SuggestModalChooser.setSelectedItem, which clamps the index to within the suggestions array.