bug(GlCollapsibleListbox): keyboard navigation doesn't work when there is no item selected
A fairly common use case for GlCollapsibleListbox is to initially have no item selected. However, if you set the selected prop to null then the keyboard navigation doesn't work. See video below:
Screen_Recording_2023-02-03_at_12.20.10_PM
Normally in this use case you would use the toggle-text prop to set the toggle button text when no item is selected. In the above video I didn't set this prop which is why the toggle button is empty.
If you set the selected prop to undefined the keyboard navigation does work
How to reproduce
- Run storybook locally
- Change src/components/base/new_dropdowns/listbox/listbox.stories.js#L144 to
null
Edited by Miguel Rincon