fix(DateInput): use useAnchoredPosition so calendar flips and clamps to viewport - #352
Merged
Merged
Conversation
…to viewport The calendar was portaled but hand-rolled its fixed positioning (always below the trigger, no flip/clamp), so it went off screen near the viewport bottom. Migrate to the shared useAnchoredPosition hook from #332.
Deploying ui with
|
| Latest commit: |
3ac15e8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4395adda.ui-6d0.pages.dev |
| Branch Preview URL: | https://fix-dateinput-calendar-clipp.ui-6d0.pages.dev |
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates DateInput’s portaled calendar from a hand-rolled fixed-positioning implementation to the shared useAnchoredPosition hook so the floating panel can vertically flip, clamp to the viewport, and apply max-height constraints near the viewport edges.
Changes:
- Replaced manual scroll/resize-driven
getBoundingClientRectpositioning withuseAnchoredPosition({ placement: 'bottom-end' }). - Updated outside-click / Escape handling effect dependencies to include the new anchor/floating refs.
- Enabled scrolling within the calendar container via
overflow-autoto support the hook’s max-height clamping behavior.
garrity-miepub
marked this pull request as ready for review
August 3, 2026 19:55
…panels Addresses Copilot review on #352 — overflow-auto was emitted by DateInput and ~15 other components but never safelisted for TW3 consumers.
Merged
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 calendar was portaled but hand-rolled its fixed positioning (always below the trigger, no flip/clamp), so it went off screen near the viewport bottom. Migrate to the shared useAnchoredPosition hook from #332.
date-input-useAnchoredPosition.mov