Closed mifi closed 2 years ago
I'd be fine either removing that line, or just throwing that error in dev -- happy to accept a PR either way.
Is this issue still open or not? if it is still open then I would like to do my first contribution.
Still an issue. Feel free to contribute :) IMO the line should be removed, or the code that counts menu items should include disabled menu items in the count. This bug is a very sneaky one because it seems to work fine, until you happen to end up in a state where all menu items are disabled (or the single item, if just one), then it will crash!
Published with v6.7.1
I get this error if I use the
disabled
prop forMenu.Item
and if all menu items in aMenu.Group
are disabled. Can we remove this line of code?https://github.com/segmentio/evergreen/blob/29f9c41ff15527dac0892330b8032ccd585b1412/src/menu/src/Menu.js#L29
Maybe instead return? I can submit a pr if this is the correct solution