question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: Popover components interfere with keyboard navigation on <a> elements contained within <PopoverButton> components

See original GitHub issue

What package within Headless UI are you using?

@headlessui/vue

What version of that package are you using?

1.5.0

What browser are you using?

Firefox latest Chrome latest

Reproduction URL

https://github.com/sps-nathan-alden-sr/tailwindui-popover-bug

Run yarn, then yarn serve to start the app.

Describe your issue

It seems that popover components interfere with the proper function of rendered <a> elements that are contained within <PopoverButton> components. In the GIF below, you can see how I tab to the links and press ENTER, which is detected by the event handler, but no navigation actually occurs. Clicking the links works as expected, as demonstrated at the very end of the animation.

navigation

The component in question is https://github.com/sps-nathan-alden-sr/tailwindui-popover-bug/blob/master/src/components/TopNavComponent.vue.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
RobinMalfaitcommented, Feb 25, 2022

Hey! Thank you for your bug report! Much appreciated! 🙏

I was also to reproduce it locally in a test and wrote a fix for it. I tested it on your repo and it works with normal a and router-link components.

This should be fixed by #1153, and will be available in the next release.

You can already try it using npm install @headlessui/vue@insiders or yarn add @headlessui/vue@insiders.

0reactions
sps-nathan-alden-srcommented, Feb 24, 2022

Yeah, I tried regular <a> elements, as well, thinking it might’ve been <router-link> magic. That’s why I think it must have something to do with event bubbling. Maybe the event is being canceled by a parent element?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Popovers - Presentation - Human Interface Guidelines - Design
A popover is a transient view that appears above other content onscreen when people click or tap a control or interactive area.
Read more >
Popover - Chakra UI
Popover is a non-modal dialog that floats around a trigger.
Read more >
Toggletip - Carbon Design System
Toggletips and tooltips are similar visually and both contain a popover and interactive trigger element. The two components differ in the way they...
Read more >
Why do clicks within Popover.Panel close the panel when ...
If the Popover is inside an element with tabindex="0" then that element will be the activeElement and the panel will be closed.
Read more >
Popover - Kaizen Design System
A popover displays rich content in a non-modal dialog to describe or add additional information when users hover over, focus on, or click...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found