fix: Prevent HelpPanel content from clipping at drawer bottom edge#4716
Open
TrevorBurnham wants to merge 1 commit into
Open
Conversation
HelpPanel reserved its bottom whitespace as margin-block-end on its last child. A descendant's block-end margin is not added to an ancestor scroll container's scrollable region, so when the panel renders inside a fixed-height, scrollable app-layout drawer, the trailing margin was clipped and content sat flush against the bottom edge. Reserve the space as padding-block-end on the panel root instead, which is included in the scroll extent and renders consistently across all app-layout drawer implementations.
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.
Description
I noticed that when I scrolled to the bottom of a
HelpPanel, there was no whitespace below the content.The cause:
HelpPanelreserved its bottom whitespace asmargin-block-endon its last child. A descendant's block-end margin is not added to an ancestor scroll container's scrollable region, so when the panel renders inside a fixed-height, scrollable app-layout drawer, that trailing margin is clipped and content sits flush against the bottom edge.This fix reserves the space as
padding-block-endon the panel root instead. An element's own padding is included in the scroll extent, so the whitespace renders consistently regardless of the wrapping container.How has this been tested?
HelpPanelunit tests pass (6/6); app-layout unit suite passes (1563 tests, 38 suites, 10 snapshots).app-layout/default).Before
After