Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
285 stars 76 forks source link

[safari] Popover returns focus to the wrong element on close #6455

Closed mpayson closed 1 year ago

mpayson commented 1 year ago

Actual Behavior

In Firefox & Chrome, when the user closes a popover, the popover returns focus to the reference element. In Safari, it returns the focus to a different element.

Expected Behavior

The popover returns focus to the reference element in all browsers

Reproduction Sample

https://codepen.io/mpayson/pen/mdjNdbG

Reproduction Steps

  1. Open code pen
  2. Click panel "i" action in the top right to open the popover
  3. Click "x" to close the popover
  4. See focus is returned to the "i" action in FF / Chrome but not Safari

Reproduction Version

1.0.4

Relevant Info

Safari 16.2

Regression?

No response

Impact

No response

Esri team

ArcGIS Online

geospatialem commented 1 year ago

Reproduced in Safari on Mac only.

Windows browsers - FF, Chrome, and Edge are not affected.

geospatialem commented 1 year ago

Research will be conducted in June to determine next steps, and if the focus trap could be responsible. A time estimate could be the resolution of the research.

driskull commented 1 year ago

I'm not sure what we can do for this one. Seems to be pretty specific to safari.

github-actions[bot] commented 1 year ago

Installed and assigned for verification.

driskull commented 1 year ago

I found this: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus

Seems like safari just doesn't focus on a button when clicking it. Which is why it doesn't go back to the focus of that button.

@geospatialem I think we can mark this as wontfix.

geospatialem commented 1 year ago

Good find, @driskull. Unfortunate it's something known to Safari. 😞

@mpayson, this is a specific issue to Safari, as Matt mentions above related to Safari bug 22261, so this is something Calcite cannot fix as its browser-specific.