fix: accordion panel scroll height overflow#1980
Open
ricardogarim wants to merge 1 commit into
Open
Conversation
🦋 Changeset detectedLatest commit: e7c3c6d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Proposed changes (including videos or screenshots)
Pages with collapsed accordion sections containing
Selectcomponents show a large blank white space at the bottom. In Rocket.Chat, this affects admin settings pages like Accounts, OAuth, and Layout.Root cause: In #1939,
HiddenSelectwas moved from insideSelectTriggerto a sibling to fix an accessibility violation. react-aria'sHiddenSelectrenders a wrapper withposition: absolute. Previously,SelectTriggeracted as its containing block. After the move, the panel (position: static) no longer contains it, so it positions relative to the nearest positioned ancestor outside the panel (e.g., a scroll viewport). The collapsed panel'soverflow: hiddendoesn't clip these escaped elements, and they inflate the scroll container'sscrollHeight.Fix: Adding
position: relativeto the panel makes it the containing block, sooverflow: hiddenproperly clips all descendants. One-line CSS change, no DOM modifications, no impact on expand/collapse animations.Issue(s)
CORE-2202
Regression from #1939.
Steps to reproduce
/admin/settings/AccountsActual result: A large blank white area is shown after the last settings item, making the page look partially empty / over-scrolled.
Expected result: The settings content should fill the available page body correctly, and the scrollable area should end after the last item without a large blank region.
Further comments
Investigation
The bug appeared between Rocket.Chat 8.4.0 (fuselage 0.76.0) and 8.5.0-develop (fuselage 0.78.0). Several hypotheses were tested and eliminated before identifying the root cause:
PageScrollableContenthas a hardcodedheight: 50vhinitialize(root)toinitialize({target: root})(Rocket.Chat PR #40391)@rocket.chat/css-in-jsupgraded from 0.31.25 to 0.32.0 (per-document WeakMap refactor)What confirmed the root cause: Git bisect across commits between 8.4.0 and develop narrowed the regression to commit
305a24255f(fuselage 0.76 -> 0.77 upgrade). Inspecting all changes in that fuselage release led to #1939, whereHiddenSelectwas moved out ofSelectTrigger. Browser inspection confirmed theHiddenSelectwrapper's containing block is the OverlayScrollbars viewport instead of the accordion panel, causing the scroll height inflation.