fix: adjust scroll margins for anonymous consent management banner and form elements of the register page#21343
Open
npapp-dev002 wants to merge 3 commits intodevelopfrom
Open
fix: adjust scroll margins for anonymous consent management banner and form elements of the register page#21343npapp-dev002 wants to merge 3 commits intodevelopfrom
npapp-dev002 wants to merge 3 commits intodevelopfrom
Conversation
…d form elements of the register page
Contributor
Merge Checks Failed |
spartacus
|
||||||||||||||||||||||||||||
| Project |
spartacus
|
| Branch Review |
fix/CXSPA-12260
|
| Run status |
|
| Run duration | 04m 19s |
| Commit |
|
| Committer | Norbert Papp |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
3
|
|
|
0
|
|
|
0
|
|
|
101
|
| View all changes introduced in this branch ↗︎ | |
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.
fix(register): scroll focused form fields into view above the anonymous consent banner
Problem
The
cx-anonymous-consent-management-bannercomponent renders as aposition: fixed; bottom: 0overlay at the bottom of the viewport. When a user navigates the registration form using the Tab key, the browser's native focus-scroll behaviour does not account for the fixed banner, causing focused form fields to be obscured behind it.Solution
A pure CSS fix was applied using two complementary browser-native scroll properties:
scroll-padding-bottomon thehtmlelement — instructs the browser to reserve bottom clearance equal to the banner height whenever it auto-scrolls a focused element into view. Applied conditionally via:has()so it is only active when the banner is actually visible.scroll-margin-bottomon register form groups and focusable elements — ensures each focusable element declares its own required bottom margin from the viewport edge, centering it in the visible area above the banner on Tab focus.A shared SCSS variable (
$cx-anonymous-consent-banner-height) was introduced to avoid magic numbers and keep all related offsets in sync.Notes
$cx-anonymous-consent-banner-heightvariable usesremunits (instead ofpx) to respect the user's browser font-size settings, which aligns with the existing codebase conventions and improves accessibility.!defaultflag allows consuming applications or custom themes to override the value if needed.:has()selector ensuresscroll-padding-bottomis only applied when the banner is rendered and visible, avoiding any side effects on other pages.QA steps
authorizationCodeFlowByDefaultfeature flag needs to be set to false in order to make the registration page visible.