spike(#3347): Add stickyHeader prop to Container#3629
Draft
Conversation
✅ Deploy Preview for goa-design-2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Adds a `stickyHeader` boolean prop to goa-container (and React/Angular wrappers) as an example of approach 3 (sticky header on individual components) for issue #3347. When stickyHeader=true: - Header uses position:sticky; top:0; z-index:1 to stay visible on scroll - Scroll listener on .content tracks position; a shadow appears under the header when content has been scrolled past the top Closes #3347 Co-authored-by: bdfranck <1479091+bdfranck@users.noreply.github.com> Agent-Logs-Url: https://github.com/GovAlta/ui-components/sessions/bd9db423-c26f-49b1-83c1-07e1af9d48ea
Copilot
AI
changed the title
[WIP] Add sticky header to Container.svelte component
feat(#3347): Add stickyHeader prop to Container component
Mar 20, 2026
Collaborator
|
@copilot The header for test 2 looks good.
But the headers for tests 1 and 3 are too thin.
|
Add flex-shrink:0 to the header element so it maintains its full height when a maxHeight constraint is applied to the container. Previously the flexbox algorithm would compress the header alongside the content area, making it too thin. Co-authored-by: bdfranck <1479091+bdfranck@users.noreply.github.com> Agent-Logs-Url: https://github.com/GovAlta/ui-components/sessions/f2c970fb-9fff-467c-ae48-11232eef0f30
Contributor
Author
... Fixed in ecec5a0. The root cause was that the All three tests now render with correct header heights: |
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.




Adds
stickyHeaderboolean prop togoa-containeras a concrete example of approach 3 (sticky behavior on individual existing components) for the sticky header/footer spike. Also fixes a pre-existing layout bug where the container header would collapse to an incorrect height whenmaxHeightwas set.Before (the change)
maxHeightwas applied to the container, due to the header lackingflex-shrink: 0in the flex-column layoutAfter (the change)
Container.svelte—stickyHeaderprop registers a scroll listener on.content; appliesposition: sticky; top: 0; z-index: 1to the header and abox-shadowwhen content has scrolled past the top. Addedflex-shrink: 0to the header so it always maintains its full height regardless of anymaxHeightconstraint on the container.stickyHeader?: boolean→stickyheader="true"attribute@Input() stickyHeader?: boolean→[attr.stickyheader]feat3347.tsxwith three test cases (internal scroll viamaxHeight, page scroll, and default/no-sticky comparison)Usage:
All three test cases with correct header heights:
Make sure that you've checked the boxes below before you submit the PR
Steps needed to test
npm run serve:prs:reactstickyHeader) withmaxHeight— header renders at correct full height⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.