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

Safari - focus-visible states not shown after mouse interactions (until focus leaves/reenters the table) #2539

Open
fredvisser opened this issue Feb 11, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@fredvisser
Copy link
Contributor

🐛 Bug Report

Keyboard focus not shown correctly on nimble-table after mouse interaction.

💻 Repro or Code Sample

In Safari:
https://nimble.ni.dev/storybook/index.html?path=/story/components-table--table&args=data:LargeDataSet

  1. Select a single row with the mouse
  2. Press 'up-arrow'

🤔 Expected Behavior

The row above your selection has the keyboard row selection state

😯 Current Behavior

There is no visible keyboard row focus state. The Tab key will move the action menu on the above row, but the focus states are all missing.
Image

💁 Possible Solution

Malcolm previously investigated and noted:

  • Straightforward to tweak focus styles for nimble-table-row / nimble-table-cell to show up in this case (example: :focus-visible =>[tabindex="0"]:focus).
  • Just changing :focus-visible to :focus isn't a general-purpose solution because it appears to take effect at multiple levels (i.e. row + cell + action menu button, even when not using :focus-within, I was seeing similar behavior to that).
  • Above style tweak works for rows/cells, but not action menu button / anchors / etc, because those have their own focus-visible styling (which may be on a subpart of the control). If we applied those styles, they'd take effect in conjunction with the existing control focus-visible styles (and we don't want both)
  • Also explored other workarounds like focusing a hidden textbox before what we wanted to focus, setting contentEditable to true just before focusing, etc. Worked in some cases (again, for the row/cell usually, but not menu button/anchor), and probably too hacky to actually go with anyway.

Filed WebCompat issue: https://webcompat.com/issues/138911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant