react-select
react-select copied to clipboard
onMenuClose fires on blur even though menu is closed
There is a call to onMenuClose on every select blur, even when the menu is closed. It was marked as solved in #3876.
Steps to reproduce:
- open codesanbox - https://codesandbox.io/s/react-select-onclosemenufires-on-blur-c2jwo?file=/src/index.tsx
- remove option from select by clicking x on it. Select focuses without menu opening (or just get select to be focused somehow)
- blur the focus by clicking outside of select
- console logs that onMenuClose fired
Thanks for all work that you put into the package.
I have a same issue
@PSoltes You can make your own component wrapper for the same with using MultiValueRemove and pass same props with overriding the onClick, it will work .
I have a same issue (not about MultiValueRemove, but called onMenuClose even though menu is closed)
Steps to reproduce:
- open codesanbox ( thanks @PSoltes )
- click Input -> menu popup shows up
- enter 'Esc' -> menu popup closed and onMenuClose fired
- blur the focus by clicking outside of select -> onMenuClose fired again even if menu popup already closed
I think onMenuClosed function should be called only one time when menu popup closed literally.
This seems like it is still an issue.
I wonder if we need a check that the menu is actually still open around this code before we run onMenuClose logic.