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

fix: useTag hook #7394

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

fix: useTag hook #7394

wants to merge 9 commits into from

Conversation

minzzang144
Copy link

Closes #7080

✅ 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:

},
rowProps: mergeProps(rowProps, domProps, linkProps, {
tabIndex: (isFocused || state.selectionManager.focusedKey == null) ? 0 : -1,
tabIndex: getTabIndex(isDisabled, isFocused, isNonFocused),
Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the opportunity to resolve this issue.
I solved an issue where the TabGroup component was deleted when it was disalbed.
I don't think it's a good code, but if there is a better code or something wrong, please point it out. thanks!

@minzzang144 minzzang144 reopened this Nov 19, 2024
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.

Thanks for the PR. It looks like you've run prettier or something equivalent over the file. Would you mind undoing that so that we can review the actual change? right now there is a bunch of noise and things that will fail our lint. Thanks again!

@minzzang144
Copy link
Author

@snowystinger Thank you for your help. Edit completed!

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.

Thanks for the quick update!

Would you mind adding a test for this?

packages/@react-aria/tag/src/useTag.ts Outdated Show resolved Hide resolved
@minzzang144
Copy link
Author

@snowystinger I wrote this by referring to the useTagGroup hook test. I'm not good at writing test code, so I'm worried about whether it's written well. If there is anything that needs correction, could you please mention it? thank you!

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.

Thanks for having a go at that. So that you know why I changed it, I focused on the behavior instead of the implementation. So interacted with the test in the same way a user would in the real world since it was reproducible there.
It was a good start though and I appreciate it. Looks good now.

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.

Disabled Tag can be removed with keyboard nav
2 participants