admin管理员组文章数量:1326338
I am using the Select component from MUI with the 'multiple' option: Select Component
Context:
- With the single option, the popover closes automatically when the user makes a selection.
- With the multiple option, the modal popover stays open so that the user can select multiple options.
However I'd like the popover to automatically close as soon as the mouse leaves the popover. Otherwise if the user tries to click somewhere else in the UI, it feels unresponsive because the modal popover was still opened. It just closes the popover. The user then needs to click a second time to access the rest of the UI.
Code Sandbox
Closing the popover using onMouseLeave in MenuProps works fine but the problem is that it often takes several clicks to open the popover. You can see in the console that an onMouseLeave event is often fired immediately after it was meant to open.
Any help much appreciated
本文标签: reactjsHow to close MUI Select (multiple) popover when mouse leavesStack Overflow
版权声明:本文标题:reactjs - How to close MUI Select (multiple) popover when mouse leaves - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742200131a2431751.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论