[select] Check for 100% max-height style#3749
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Greptile SummaryThis PR fixes a regression in the select component's Root Cause: Solution: Changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant SelectPopup
participant getMaxPopupHeight
participant Browser
User->>SelectPopup: Open select with alignItemWithTrigger active
SelectPopup->>Browser: Set popupElement.style.height = '100%'
SelectPopup->>Browser: getComputedStyle(popupRef.current)
Browser-->>SelectPopup: CSSStyleDeclaration
SelectPopup->>getMaxPopupHeight: Call with popupStyles
getMaxPopupHeight->>getMaxPopupHeight: Check if maxHeightStyle === '100%'
alt maxHeightStyle is '100%'
getMaxPopupHeight-->>SelectPopup: Return Infinity
else maxHeightStyle is numeric
getMaxPopupHeight->>getMaxPopupHeight: parseFloat(maxHeightStyle)
getMaxPopupHeight-->>SelectPopup: Return parsed value or Infinity
end
SelectPopup->>SelectPopup: Calculate viewportHeight using maxPopupHeight
SelectPopup->>Browser: Apply positioning and height styles
|
f14960d to
2ead2c6
Compare
The "old" JSX structure without
<Select.List>regressed from #3573, but this is still supported. Themax-heightwas calculated as100%due to the inline style, which we can check for.https://deploy-preview-3749--base-ui.netlify.app/experiments/long-select