rgossiaux / svelte-headlessui

Unofficial Svelte port of the Headless UI component library
https://svelte-headlessui.goss.io
MIT License
1.78k stars 96 forks source link

Popover does not close on PopoverButton click on Safari (macOS & iOS) #115

Open Robin-w151 opened 2 years ago

Robin-w151 commented 2 years ago

Describe the bug When the parent element of a Popover component is focusable (e.g. div with tabindex), the Popover won't close if the PopoverButton is clicked.

Affected browser: Safari (macOS & iOS)

To Reproduce REPL

Library version 1.0.2

Robin-w151 commented 2 years ago

When playing around with the REPL, I discovered that on Safari the PopoverButton receives focus on every click, thus the Popover is briefly closed and then opened again. I assume that Safari transfers the focus to the parent element and then again to the button element, thus a new focus event is triggered on every click.

ondrejjcizek commented 1 year ago

How can I contribute in this repo?