Skip to content

Conversation

@maximo-macchi-cb
Copy link
Contributor

What changed? Why?

This PR adds docs pages for the <FocusTrap> component. This component is used more as a util component for internal CDS component composition. However, the component is fully functional and can be used by CDS customers. Therefore, a proper documentation page should be added for it.

Also, a bug in <FocusTrap> is fixed where when the includeTriggerInFocusTrap prop was set to true, the focus would still shift to inside the <FocusTrap>.

Root cause (required for bugfixes)

The root cause of the bug is in the last useEffect in the component where the initial auto focus logic is. There was no check for the includeTriggerInFocusTrap prop and the query for focusable elements doesn't include the trigger. This PR's fix updates the query so that the trigger is included in the focusable elements array when the prop is true.

UI changes

iOS Old iOS New
old screenshot new screenshot
Android Old Android New
old screenshot new screenshot
Web Old Web New
old screenshot new screenshot

Testing

How has it been tested?

  • Unit tests
  • Interaction tests
  • Pseudo State tests
  • Manual - Web
  • Manual - Android (Emulator / Device)
  • Manual - iOS (Emulator / Device)

Testing instructions

Illustrations/Icons Checklist

Required if this PR changes files under packages/illustrations/** or packages/icons/**

  • verified visreg changes with Terran (include link to visreg run/approval)
  • all illustration/icons names have been reviewed by Dom and/or Terran

Change management

type=routine
risk=low
impact=sev5

automerge=false

@maximo-macchi-cb maximo-macchi-cb self-assigned this Dec 17, 2025
@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Dec 17, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 1
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1
CODEOWNERS 🟡 See below

🟡 CODEOWNERS

Code Owner Status Calculation
ui-systems-eng-team 🟡 0/1
Denominator calculation
Additional CODEOWNERS Requirement
Show calculation
Sum 0
0
From CODEOWNERS 1
Sum 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants