eui icon indicating copy to clipboard operation
eui copied to clipboard

[EuiComboBox] Regression in singleSelection scrolling behavior

Open wenchonglee opened this issue 3 years ago • 0 comments

Hey,

I noticed that after #4879, an EuiComboBox with singleSelection will no longer scroll to the selected option on open. You can verify this behavior by going to the sandbox found in #4072, and alternating between versions 34.4.0 and 34.5.0. (open the first combobox in the sandbox)

I think this is because of line 158 added in componentDidUpdate, as this condition will never be true on mount.

https://github.com/elastic/eui/blob/efad82b13106474c83f19eeb535e037b5af13e44/src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx#L155-L161

I haven't sat down to think of a solution yet, maybe we could add a similar scrollToItem call in componentDidMount? (without this condition)

wenchonglee avatar Jul 14 '21 03:07 wenchonglee