atomiks / tippyjs

Tooltip, popover, dropdown, and menu library
https://atomiks.github.io/tippyjs/
MIT License
11.91k stars 518 forks source link

Persistent focus-visible style within interactive tippy after Esc to hide #988

Open Stigjb opened 2 years ago

Stigjb commented 2 years ago

Bug description

This is a visual bug caused by the data-focus-visible-added attribute persisting after hiding the popover with Esc. See the screenshot for an example.

bilde

Expectation

Hiding a popover with Esc should have the same behaviour as hiding by clicking outside, i.e. removing the data-focus-visible-added attribute.

Replication

This issue can be replicated on the Tippy demo page:

  1. Click the "Dropdown" button
  2. Press Tab three times to focus the heart emoji
  3. Press Esc to close the popover
  4. Click the "Dropdown" button again
  5. The heart emoji still has focus style
  6. Press tab to focus an emoji. There are now two focused elements