Skip to content

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

Open
@AdelheidF

Description

@AdelheidF

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    0 - newNew issues that need assignment.ArcGIS Map ViewerIssues logged by ArcGIS Map Viewer team members.bugBug reports for broken functionality. Issues should include a reproduction of the bug.estimate - 3A day or two of work, likely requires updates to tests.has workaroundIssues have a workaround available in the meantime.impact - p1 - need for current milestoneUser set priority impact status of p1 - need for current milestonep - highIssue should be addressed in the current milestone, impacts component or core functionality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions