evergreen icon indicating copy to clipboard operation
evergreen copied to clipboard

SelectMenu closeOnSelect doesn't work with isMultiSelect

Open ahsan-sabir opened this issue 2 years ago • 3 comments

ahsan-sabir avatar Sep 16 '22 19:09 ahsan-sabir

Looking at the code, I think this was intentional:

https://github.com/segmentio/evergreen/blob/80f4f65714a02cdca69f6f4ac5663e38db111ec7/src/select-menu/src/OptionsList.js#L128-L141

I'm thinking closing the select menu would lead users to believe they can only select one option, and they wouldn't reopen it to select another.

brandongregoryscott avatar Sep 28 '22 12:09 brandongregoryscott

I see it's a feature not a bug 😄

"I'm thinking closing the select menu would lead users to believe they can only select one option, and they wouldn't reopen it to select another."

I don't think that would be a problem since it will only close with explicit closeOnSelect. My particular use case involves making an expensive api req on each select, so I have to close the select menu and disable it until current req completes.

ahsan-sabir avatar Sep 28 '22 17:09 ahsan-sabir

I don't think that would be a problem since it will only close with explicit closeOnSelect.

That's a good point. Looks like we don't default closeOnSelect to true, so this wouldn't break the existing behavior for consumers using the multi-select version, unless they were also trying to use both props together.

brandongregoryscott avatar Sep 28 '22 17:09 brandongregoryscott