Repository navigation
feat(ui5-dynamic-page): add stickySubheaderArea slot - #14253
NakataCode wants to merge 8 commits into
Conversation
|
🚀 Deployed on https://pr-14253--ui5-webcomponents-preview.netlify.app |
👋 Heads-up: dev close is in effectThanks for the contribution! This repository is currently in dev close ahead of release This PR appears to introduce public-API changes (detected by diffing the Custom Elements Manifest against the latest published version on npm):
Could you please hold off on merging into 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.
Posted automatically by the Dev Close Notice workflow. |
dobrinyonkov
left a comment
There was a problem hiding this comment.
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.
Summary
Adds a new
stickySubheaderAreaslot toui5-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-tabcontainerproviding 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
position: stickykeeps it flush below the header as it scrolls away and pins it once collapsed, with no per-scroll computation. A singleResizeHandleron the wrapper keeps the offset correct when the title/header resizes (async content, responsive layout).scrollPaddingTopis 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
WithTabssample on the websitescrollPaddingTopcaseJIRA: BGSOFUIPIRIN-7142