sci-components
sci-components copied to clipboard
DropdownMenu repeats `groupBy` sections unless menu items in the same sections are listed adjacently
Describe the bug Menu items are displayed in the order they are listed, so if a menu item in a different group is listed between two within the same group, the section label for those with the same section label will actually be duplicated and the menu items will be shown in their provided order.
To Reproduce Steps to reproduce the behavior:
- Go to the DropdownMenu's Zeroheight documentation, specifically the "DropdownMenu with grouped sections" section
- See how there are two “SECTION B”'s split by “SECTION C” in the below example; may need to scroll the DropdownMenu and compare to the
MENU_OPTIONS
array in the code example.
Expected behavior According to the MUI Autocomplete documentation "make sure that the options are also sorted with the same dimension that they are grouped by, otherwise, you will notice duplicate headers", so it seems that our DropdownMenu component is not currently following what they suggest...?
Screenshots
Note: once this is fixed, be sure to update the last couple sentences of the "DropdownMenu with grouped sections" section in the DropdownMenu's Zeroheight documentation