Skip to content

fix: persist focus on consent#21309

Open
rmch91 wants to merge 5 commits intodevelopfrom
CXSPA-11392
Open

fix: persist focus on consent#21309
rmch91 wants to merge 5 commits intodevelopfrom
CXSPA-11392

Conversation

@rmch91
Copy link
Copy Markdown
Contributor

@rmch91 rmch91 commented Mar 31, 2026

Closes: https://jira.tools.sap/browse/CXSPA-11392

QA steps:
Checkbox focus retained on toggle

  1. Open the storefront as an anonymous (not logged in) user
  2. Click the "Consent management" link in the footer to open the Anonymous Consent Dialog
  3. Tab to a consent checkbox
  4. Press Space to toggle the checkbox

Expected: Focus remains on the same checkbox. A success message appears but does not steal focus.
Press Space again to un-toggle
Expected: Focus still remains on the same checkbox.

Message close restores focus

  1. Open the Anonymous Consent Dialog
  2. Toggle a checkbox (success message appears)
  3. Tab to the message close button and press Space
    Expected: Focus returns to the previously toggled checkbox

@rmch91 rmch91 requested a review from a team as a code owner March 31, 2026 09:39
@github-actions github-actions bot marked this pull request as draft March 31, 2026 09:39
@rmch91 rmch91 marked this pull request as ready for review March 31, 2026 13:13
@github-actions
Copy link
Copy Markdown
Contributor

Merge Checks Failed

Please push a commit to re-trigger the build.
To push an empty commit you can use `git commit --allow-empty -m "Trigger Build"`

@github-actions github-actions bot marked this pull request as draft March 31, 2026 13:16
@rmch91 rmch91 marked this pull request as ready for review March 31, 2026 13:18
@cypress
Copy link
Copy Markdown

cypress bot commented Mar 31, 2026

spartacus    Run #52552

Run Properties:  status check passed Passed #52552  •  git commit 592fddb15d ℹ️: Merge be0716151e922ae21a664a4840c7821d4ebdb0c4 into 65b052be3484c32b1ff50a9284aa...
Project spartacus
Branch Review CXSPA-11392
Run status status check passed Passed #52552
Run duration 04m 12s
Commit git commit 592fddb15d ℹ️: Merge be0716151e922ae21a664a4840c7821d4ebdb0c4 into 65b052be3484c32b1ff50a9284aa...
Committer Roman
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 3
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 101
View all changes introduced in this branch ↗︎

@github-actions github-actions bot marked this pull request as draft April 1, 2026 09:59
@rmch91 rmch91 marked this pull request as ready for review April 1, 2026 10:01
Copy link
Copy Markdown
Contributor

@Pio-Bar Pio-Bar left a comment

Choose a reason for hiding this comment

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

Changes look good to me. I've tested the ConsentDialogComponent and the focus stays on checkboxes after toggling. It is not lost after the success message is closed. The Screen reader output seems consistent as well.

However, I see the original ticket concerned the ConsentManagementComponent not the dialog. When testing on /my-account/consents the focus is lost after toggling the checkboxes. The component re-renders causing the focus to default to the body element. Is this in the scope of the ticket?

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.

2 participants