Place a popover again when its content changes size - #2878
Merged
Merged
Conversation
brhellman
force-pushed
the
fixed-popover-refit
branch
from
September 18, 2026 16:31
1c09061 to
ec51fd4
Compare
The event card becomes the editor in place, through the card's own state, so FixedPopover never measured the taller box: it stayed centred where the card had been and its footer ran past the bottom of the window. A ResizeObserver on the popover now restarts placement from the requested direction, as opening at the new size would. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
brhellman
force-pushed
the
fixed-popover-refit
branch
from
September 18, 2026 18:48
ec51fd4 to
e882b82
Compare
Contributor
|
Looks good to me. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The follow-up from #2874: with the card and editor scrolling inside the window, the editor's footer could still sit below it.
PopoverStorerenders oneFixedPopoverper open, and the card becomes the editor throughCalendarEventPopover's own state, so nothing onFixedPopoverchanged and it never measured the taller box. The editor stayed centred where the card had been, and with the anchor low in the window its Save row ran past the bottom.FixedPopovernow observes its own size with aResizeObserverand, once the content changes size after placement, restarts placement from the requested direction, flipping, nudging and clamping as opening at the new size would. The observer's first callback and the placement passes themselves are ignored through aplacingflag, so the re-placement runs once per size change rather than looping. The card shrinking back to its size on Cancel takes the same path.Verification
Static, on this exact commit:
lint:check0,typecheck0, full suite 1885 passing locally and on fork CI: run 35296344907, green.Spec: a 100px child anchored at y=400 in a 500px window is placed beside its anchor; grown to 2000px, the popover is placed again and its top comes back inside the window. The spec drives the inner
FixedPopoverthe AutoFocuses decorator renders, since that is where placement state and refs live; placement passes run on the mocked clock and the resize step is awaited through the real observer. Mutation: with theobservecall removed, the spec times out waiting for the size change to be observed and nothing else fails.Live A/B on a real account (same config copy, task queue and recurring dialog stubbed), opening the card for the same recurring event with invitees and clicking its edit icon with real mouse input; the viewport height is set with the page zoom factor so both builds are measured at the same CSS height:
09eb665cc: editor bottom, SaveelementFromPointat its centrenullnullOn master the card itself fit in both cases (bottom 836 and 649); only the editor it turned into did not.
🤖 Generated with Claude Code