Skip to content

fix: prevent useTooltipTrigger from setting tabIndex #8622

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

abeljohn
Copy link
Contributor

Closes #8556

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

property added in 53d8ed2

wasn't able to think of any counter example, but added some tests

})
onKeyDown: onPressStart
}),
tabIndex: undefined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the undefined needed here at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the focusableProps here include a tabIndex, which then gets passed into FocusableContext. for the component consuming that context via useFocusable, the props from context (interactionProps) take precedence over the tabIndex determined by excludeFromTabOrder/isDisabled

another potential fix is to have useFocusable's calculated tabIndex take precedence over the props coming from the context, but that may be a riskier change

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

Successfully merging this pull request may close these issues.

excludeFromTabOrder is ignored on children of TooltipTrigger
3 participants