fix(popover): restart tracked positioning for lazy-mounted positioners#3092
fix(popover): restart tracked positioning for lazy-mounted positioners#3092aleclarson wants to merge 1 commit intochakra-ui:mainfrom
Conversation
This change introduces a restartPositioning method to the popover API, allowing users to manually restart the positioning session. It also refactors how positioning is tracked internally by using a ref to store the cleanup function. This ensures that the positioning session can be properly restarted or cleaned up without relying solely on the effect lifecycle.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
Hey! Could you show a reproduction of the issue you’re attempting to fix? |
|
It seems to be an issue with Preact only. Though I wasn't using |
Description
Restarts the tracked popover positioning session when a lazy-mounted positioner appears, so observers can attach after the floating node exists.
⛳️ Current behavior (updates)
Controlled, lazy-mounted popovers can miss the initial tracked positioning pass because the positioner is not in the DOM yet.
New behavior
The machine now has a dedicated
restartPositioning()path for rebuilding the tracked positioning session after mount.reposition()stays as the one-shot manual path.Is this a breaking change (Yes/No):
No
Additional Information
This is still a draft. I did not add tests, and I won't have time to push this through to the finish from here. If this direction looks useful, it'd be great if someone could pick it up. Thanks for your time.