sci-components icon indicating copy to clipboard operation
sci-components copied to clipboard

DropdownMenu repeats `groupBy` sections unless menu items in the same sections are listed adjacently

Open liaprins opened this issue 1 year ago • 1 comments

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:

  1. Go to the DropdownMenu's Zeroheight documentation, specifically the "DropdownMenu with grouped sections" section
  2. 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 Screenshot 2023-06-23 at 6 29 51 PM Screenshot 2023-06-23 at 6 31 09 PM Screenshot 2023-06-23 at 6 31 40 PM

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

liaprins avatar Jun 24 '23 01:06 liaprins