Repository navigation
Commit fc1600a
committed
fix(base-ui): connect MenuStore floating root context to useSyncedFloatingRootContext
MenuRoot built a local floating root via useSyncedFloatingRootContext but never
installed it on MenuStore, which kept the empty placeholder from
createInitialPopupStoreState. This caused MenuTrigger, MenuPopup,
MenuPositioner, and MenuStore.setOpen to read a different (inert) context than
Root's dismiss/list-navigation hooks.
Fix: follow the same pattern as Dialog/Popover/Tooltip stores—create a real
FloatingRootStore via createPopupFloatingRootContext in the MenuStore constructor,
and pass store.state.floatingRootContext into useSyncedFloatingRootContext so the
sync hook reuses it instead of minting a private disconnected instance.1 parent b4d2510 commit fc1600a
1 file changed
Lines changed: 8 additions & 2 deletions
File tree
- packages/base-ui/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
328 | 333 | | |
329 | | - | |
| 334 | + | |
330 | 335 | | |
331 | 336 | | |
332 | 337 | | |
| |||
337 | 342 | | |
338 | 343 | | |
339 | 344 | | |
340 | | - | |
| 345 | + | |
341 | 346 | | |
342 | 347 | | |
343 | 348 | | |
| |||
821 | 826 | | |
822 | 827 | | |
823 | 828 | | |
| 829 | + | |
824 | 830 | | |
825 | 831 | | |
826 | 832 | | |
| |||
0 commit comments