Skip to content

feat(ui5-dynamic-page): add stickySubheaderArea slot - #14253

Open
NakataCode wants to merge 8 commits into
mainfrom
dynamicpage-sticky-subheader
Open

NakataCode wants to merge 8 commits into
mainfrom
dynamicpage-sticky-subheader

Conversation

@NakataCode

@NakataCode NakataCode commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a new stickySubheaderArea slot to ui5-dynamic-page. Content placed here is pinned directly below the visible header and stays anchored as the header collapses or snaps, instead of scrolling away with the page content.

The primary use case is a ui5-tabcontainer providing in-page tab navigation that remains constantly visible (ObjectPage-style anchor bar).

Supported across all header states: expanded, mid-collapse, pinned, snapped, and the mobile snapped-title layout. An empty slot has zero height, so existing pages are unaffected.

Implementation notes

  • The band's sticky offset is the height of the title/header wrapper. position: sticky keeps it flush below the header as it scrolls away and pins it once collapsed, with no per-scroll computation. A single ResizeHandler on the wrapper keeps the offset correct when the title/header resizes (async content, responsive layout).
  • scrollPaddingTop is derived from the same wrapper height (plus the band), so keyboard focus scrolls elements clear of the sticky areas. This also corrects a pre-existing undershoot when the header is pinned.

Also included

  • WithTabs sample on the website
  • Regression test for the pinned, no-subheader scrollPaddingTop case

JIRA: BGSOFUIPIRIN-7142

@sap-ui5-webcomponents-release

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

👋 Heads-up: dev close is in effect

Thanks for the contribution! This repository is currently in dev close ahead of release 2.29 (scheduled 2026-11-18, UTC). See the release schedule for the full timeline.

This PR appears to introduce public-API changes (detected by diffing the Custom Elements Manifest against the latest published version on npm):

@ui5/webcomponents-fiori

  • ➕ added slot: stickySubheaderArea

Could you please hold off on merging into main until the release ships? Public-API changes are best landed in the next dev cycle so they don't slip into the release at the last minute. Once the release is out, this PR is good to go.

If this change must ship in the current release, please request a review from one or two members of @UI5/ui5-team-webc so the team can sign off explicitly.

💬 False positive? If you believe this PR doesn't actually change the public API (e.g. only internal refactoring, or an entry the detector mis-attributed), please reply on this thread — your feedback helps us improve the detection during this trial run.

Posted automatically by the Dev Close Notice workflow.

@dobrinyonkov dobrinyonkov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice feature, and the tests cover the sticky behavior well. I tried it locally and found two problems in the website sample and a few things in DynamicPage.ts that can be simpler. Details are inline.

packages/website/docs/components/fiori/samples.json

The WithTabs sample is not listed here, so it does not show on the website. The component pages are built from this file, and a sample folder without an entry is skipped. Please add this under DynamicPage:

{ "name": "WithTabs", "title": "With Tabs" }

Suggestion: a sample with tabs that scroll to sections

Can we also add a sample with tabs in the sticky area that scroll to sections? It is the pattern people know from ObjectPage: clicking a tab jumps to its section, and scrolling the page selects the matching tab.

It should also handle subsections, as ObjectPage does. For example, a tab could open a menu of its subsections, or sub-tabs could scroll to them. While scrolling, the selected tab and subsection should follow what is on screen.

The sample should handle the gaps too, so it works properly and not only in the happy case:

  • The section title must not end up under the sticky title and tabs when you jump to it.
  • The jump should be smooth, and the selected tab should not flicker on the way.
  • It must still be right when the header snaps while scrolling.
  • The last section must be able to scroll all the way up under the tabs.

I tried a version with sections locally and it works, and I can share it. It needs some workarounds because DynamicPage only sets scroll-padding-top on focus, so scrollIntoView and anchor links do not account for the sticky area. If we want this to be easy for users, the component should handle that.

Comment thread packages/fiori/src/DynamicPage.ts Resolved
Comment thread packages/fiori/src/DynamicPage.ts Resolved
Comment thread packages/fiori/src/DynamicPage.ts Resolved
Comment thread packages/fiori/src/DynamicPage.ts Resolved
Comment thread packages/fiori/src/DynamicPage.ts Resolved
@ilhan007
ilhan007 deployed to netlify-preview November 26, 2026 09:01 — with GitHub Actions Active
@NakataCode
NakataCode deployed to netlify-preview November 26, 2026 12:43 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
netlify-preview — 7cafc8ec Deployed Nov 26, 2026 by NakataCode via deploy-preview #3854
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants