Skip to content

calcite-dialog: setting focusTrapEnabled by default isn't working #12279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 6 tasks
AdelheidF opened this issue Jun 3, 2025 · 2 comments
Open
2 of 6 tasks

calcite-dialog: setting focusTrapEnabled by default isn't working #12279

AdelheidF opened this issue Jun 3, 2025 · 2 comments
Labels
0 - new New issues that need assignment. ArcGIS Map Viewer Issues logged by ArcGIS Map Viewer team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 3 A day or two of work, likely requires updates to tests. has workaround Issues have a workaround available in the meantime. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@AdelheidF
Copy link

AdelheidF commented Jun 3, 2025

Check existing issues

Actual Behavior

If I create a dialog with focusTrapEnabled by default it doesn't seem to work. If I then open a popover and click outside the popover it is no longer reacting.
If I set focusTrapEnabled on the dialog about 1 second after it was added to the DOM then it works fine.
Same if I edit the DOM by hand and add/re-add focusTrapEnabled on the dialog.

cc @driskull

Expected Behavior

focusTrapEnabled takes effect immediately when the dialog is opened.

Reproduction Sample

https://codepen.io/afreitag/pen/ByNLEMK

Reproduction Steps

Click on button, click on list, works fine.
Now click outside the popover once and come back to list, no longer focuses on the list.
Now enabled commented out code and do the same test. Now it works.

Reproduction Version

3.2.1

Relevant Info

No response

Regression?

probably

Priority impact

impact - p1 - need for current milestone

Impact

popover inside a dialog can get unresponsive

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/calcite-ui-icons
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Map Viewer

@AdelheidF AdelheidF added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Jun 3, 2025
@github-actions github-actions bot added ArcGIS Map Viewer Issues logged by ArcGIS Map Viewer team members. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone labels Jun 4, 2025
@geospatialem geospatialem added the has workaround Issues have a workaround available in the meantime. label Jun 4, 2025
@geospatialem
Copy link
Member

The above has a workaround, where when after the dialog is open the focus trap can be disabled.

Additional expertise should seek out if other components are effected by the above, adding a spike to the issue to reflect the research needed prior to a fix to determine effects across components.

@geospatialem geospatialem added spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment. and removed needs triage Planning workflow - pending design/dev review. spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment. labels Jun 4, 2025
@geospatialem
Copy link
Member

The above impacts only dialog, and can be depicted via https://codepen.io/driskull/pen/emNgNeK

@geospatialem geospatialem added p - high Issue should be addressed in the current milestone, impacts component or core functionality estimate - 3 A day or two of work, likely requires updates to tests. labels Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. ArcGIS Map Viewer Issues logged by ArcGIS Map Viewer team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 3 A day or two of work, likely requires updates to tests. has workaround Issues have a workaround available in the meantime. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality
Projects
None yet
Development

No branches or pull requests

2 participants