Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menubar: context.focused is true on hover #5710

Open
lisuzanne94 opened this issue May 8, 2024 · 1 comment
Open

Menubar: context.focused is true on hover #5710

lisuzanne94 opened this issue May 8, 2024 · 1 comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@lisuzanne94
Copy link

Describe the bug

When using passthrough to apply a style to a context.focused state, the styles are also getting triggered on mouse hover. For accessibility reasons, I'm looking for the ability to add styles (like a ring or an outline) when a user is navigating with their keyboard but not on mouse hover.

I've tried adding focus and focus-visible styles but they don't seem to get applied.

Would appreciate some guidance if the ability to separate the two already exists or if there is some kind of workaround. Thank you.

Reproducer

https://codesandbox.io/p/devbox/magical-almeida-xk4gqv?file=%2Fsrc%2FApp.vue%3A1%2C15&workspaceId=7dee12f5-26e9-446c-9061-a67fb6cacaac

PrimeVue version

^3.52.0

Vue version

3.x

Language

ES6

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. To see focus style, use Tab and arrow keys to cycle through menu. You should see a ring around the focused item
  2. Click on a menu item and then mouse hover over other menu items. They'll also receive the ring despite not being focused

Expected behavior

Keyboard navigation cycling through menu items applies the ring when focused on one. Using a mouse to hover over items should not apply the same style. Ideally, there's a way to apply different styles on keyboard navigation and mouse actions.

@lisuzanne94 lisuzanne94 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 8, 2024
@kaspernowak
Copy link

I am experiencing a related issue with the menubar. When a menu item is clicked or focused with tab, following hovers over other menu items apply the same focus behaviour, this is not expected. This has more serious implications when zooming in with mouse gestures on a m1 macbook, resulting in panning to the hovered menu items causing very unexpected behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants