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

Popover with disabled={true} or empty content prevents focus from reaching wrapped MenuItem #7046

Open
evansjohnson opened this issue Nov 4, 2024 · 1 comment

Comments

@evansjohnson
Copy link
Contributor

See https://github.com/palantir/blueprint/blob/develop/packages/core/src/components/popover/popover.tsx#L371-L373

Environment

  • Package version(s): BP-core 5.13.0
  • Operating System: Mac Sonoma 14.7
  • Browser name and version: Island Version 1.50.25 Chromium: 129.0.6668.59

Code Sandbox

Link to a minimal repro: https://codesandbox.io/p/devbox/peaceful-shadow-yqcnf7

Steps to reproduce

  • Attempt to tab to button with disabled tooltip, or tooltip with empty content
  • Button does not receive focus due to disabled popover

Actual behavior

  • Disabled popover prevents target from being focused

Expected behavior

  • Just because a tooltip on a menu item is disabled (either through the prop, or through setting no content), does not mean the menu item itself is disabled and should not receive focus

Possible solution

unsure, at first I thought tabIndex was being clobbered but it does look like we take care to not clobber a defined tab index here: https://github.com/palantir/blueprint/blob/develop/packages/core/src/components/popover/popover.tsx#L426

I suspect this problem is not specific to MenuItem even though it is appearing there

@evansjohnson
Copy link
Contributor Author

Workaround to conditionally not wrap in a Tooltip when disabled, but being able to use the prop would be more ergonomic and would probably prevent some uncaught focus issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant