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(Checkbox): bind data-n-ids to root element #1495

Merged
merged 2 commits into from
Mar 9, 2024

Conversation

romhml
Copy link
Collaborator

@romhml romhml commented Mar 9, 2024

πŸ”— Linked issue

Resolves #1485

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Bind data-n-ids attribute to root element of the Checkbox component to fix hydration mismatch caused by using useId with inheritAttrs: false.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@benjamincanac
Copy link
Member

Thanks @romhml! Do you have an idea why this happens on the Checkbox but not the RadioGroup for example?

@romhml
Copy link
Collaborator Author

romhml commented Mar 9, 2024

@benjamincanac that's because inheritAttrs is set to true on the Radio component, I'll update it to replicate the same behavior as the Checkbox.

Copy link
Member

I didn't notice that, all components should have inheritAttrs: false to merge classes.

@benjamincanac benjamincanac changed the title fix(Checkbox): bind data-n-ids to root element fix(Checkbox): bind data-n-ids to root element Mar 9, 2024
@benjamincanac benjamincanac merged commit a2b8b70 into dev Mar 9, 2024
2 checks passed
@benjamincanac benjamincanac deleted the fix-checkbox-hydration-mismatch branch March 9, 2024 14:58
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.

Checkbox: Hydration mismatch
2 participants