tailwindui-issues icon indicating copy to clipboard operation
tailwindui-issues copied to clipboard

PopoverButton on click , always shows tab focus

Open audelk opened this issue 1 year ago • 1 comments

this is in nextjs. i use the sample flyoutmenus. 2024-06-272

audelk avatar Jun 27 '24 11:06 audelk

its very annoying, as you can see,every time i click "cars" , it automatically shows the tab focus .

audelk avatar Jun 27 '24 11:06 audelk

outline-none

pawelek7k avatar Jul 08 '24 21:07 pawelek7k

Hey there! Apologies for the delayed response — I'm sure you've long moved on from this, but for the benefit of others I would just reiterate what @pawelek7k suggested. If you add the outline-none class to your PopoverButton this outline will go away.

However, I'd recommend still adding a focus ring when focused using the keyboard. You can do this using the data-[focus]:ring class for this.

For example:

- <PopoverButton className="inline-flex items-center gap-x-1 text-sm font-semibold leading-6 text-gray-900">
+ <PopoverButton className="inline-flex items-center gap-x-1 text-sm font-semibold leading-6 text-gray-900 outline-none data-[focus]:ring">

Hope that helps! 👍

reinink avatar Sep 06 '24 00:09 reinink