base-ui
base-ui copied to clipboard
[menu] Fix (click, drag outside, release) not closing the menu
#2094 broke cancelling opening of the menu by dragging outside.
Here I'm setting a root id on every menu popup and when a mouse pointer is released over an element I check if this element belongs to the root.
Bundle size report
| Bundle | Parsed Size | Gzip Size |
|---|---|---|
| @base-ui-components/react | 🔺+312B(+0.10%) | 🔺+133B(+0.14%) |
Generated by :no_entry_sign: dangerJS against 4d0f66d965ff831072f0ea3d35e8fea8cfd707d0
Deploy Preview for base-ui ready!
| Name | Link |
|---|---|
| Latest commit | 4d0f66d965ff831072f0ea3d35e8fea8cfd707d0 |
| Latest deploy log | https://app.netlify.com/projects/base-ui/deploys/686387eb5cd45b00085bbcf5 |
| Deploy Preview | https://deploy-preview-2156--base-ui.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
This seems to break the exit animation when you mousedown -> mousemove into a submenu -> mouseup
I can't reproduce it. Does it still happen to you after the last merge commit?
https://github.com/user-attachments/assets/e6d91f58-a390-45a3-854d-060a2a79a7c6
It happens with Menubar. It also happens when moving to a different menu, not just a submenu
Alright, fixed.
I was able to get into this state where dragging to a new menu trigger doesn't open it:
https://github.com/user-attachments/assets/2603f577-775c-4c21-8e9c-28ba4c0fa859
This also exists in master, looks like a regression.
It also happens if you try to mouseenter in general to the next trigger, regardless of the drag