-
Notifications
You must be signed in to change notification settings - Fork 79
Description
Check existing issues
- I have checked for existing issues to avoid duplicates and reviewed the Accessibility page for guidance.
Summary
When the esc
key is pressed when the calcite popover is open, it will always close the popover, even if the focus is elsewhere in the web page.
When clicked outside of the focus trap (like on the map for example), we would expect the esc
key to no longer affect the popover, at least until the focus is returned to that element.
Ideal behavior:
- When escape is pressed, focus is returned to the element prior to the focus trap
- When clicked outside of a focus trap, focus is not returned to the element prior to the focus trap
Currently, in both of the scenarios above, focus is returned to the element prior to the focus trap. It seems like we may want different things depending on if the focus trap is deactivated due to a click vs escape key press.
Actual Behavior
The esc
key will always close the popover, even if the focus is no longer on the popover.
The focus will always return to the element prior to the focus trap, even if it is deactivated due to a click elsewhere.
Expected Behavior
When clicked outside of a focus trap, the focus should not be returned to the element prior to the focus trap.
Reproduction Sample
https://codepen.io/driskull/pen/zYgaNQP
Reproduction Steps
- open the popover
- press escape
- notice the button is focused
- open the popover
- click outside of the popover
- notice the button is focused
- click again outside of the popover and the focus on the button is now gone.
Reproduction Version
2.13.2
Working W3C Example/Tutorial
No response
Relevant Info
related JS SDK issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/66350#issuecomment-5110811
Regression?
No response
Priority impact
impact - p3 - not time sensitive
Calcite package
- @esri/calcite-components
- @esri/calcite-components-react
- @esri/calcite-design-tokens
- @esri/eslint-plugin-calcite-components
Esri team
ArcGIS Maps SDK for JavaScript