nrkno / core-components

Accessible and lightweight Javascript components
https://static.nrk.no/core-components/latest/
MIT License
117 stars 10 forks source link

core-toggle: closing with esc does not work in webkit #719

Closed klizter closed 7 months ago

klizter commented 1 year ago

Closing core-toggle in safari webkit with escape key press does not work.

Steps to reproduce:

  1. Locate test closes nested toggle with esc
  2. Remove if (browserName === 'webkit') test.skip()
  3. Run the test with webkit as browser

Expected result Should first escape key-press close the nested core-toggle and on subsequent escape key-press close the root core-toggle

Actual result Does not close core-suggest

Note: Debugging the issue points to a focus management issue; document.activeElement points to core-toggle button in chromium and firefox, while webkit points to html body, that being after having expanded all the core-toggles.