Sharlaan/material-ui-superselectfield

Is there a way to setState during, before or after selectionsRenderer()?

jwmann opened this issue · 2 comments

A bug I've been getting that's been finding it's way into a bunch of other edge-cases is the fact that the state values is only set after the menu closes.

A perfectly example of this bug can be reproduced in demo 3 if you position the menu underneath the inputs, this reveals the chips, a much nicer experience UX-wise.

If during the selection phase, i.e. the menu is open, chips are being rendered with 'X's that allow you to remove them. However, this function relies on the state to already have them in it, so if you click the 'X' before you've closed the menu, you'll lost all your selections.

If there was a way to set the state during the click, it would not only be more efficient but would solve a bunch of other edge-cases.

I basically need a way to do what handleMenuSelection() does.

The new prop onSelect might solve your issue : please tell me how it goes with v1.8.4 ^^