Skip to content

fix(button): omit href when disabled to avoid invalid <button href>#2948

Merged
metonym merged 1 commit intomasterfrom
metonym/strip-href-disabled-button
May 9, 2026
Merged

fix(button): omit href when disabled to avoid invalid <button href>#2948
metonym merged 1 commit intomasterfrom
metonym/strip-href-disabled-button

Conversation

@metonym
Copy link
Copy Markdown
Collaborator

@metonym metonym commented May 9, 2026

When both href and disabled are passed, the anchor branch is skipped and buttonProps.href would spread onto <button>, producing invalid HTML.

Mirror the existing type ternary to drop href if disabled is true.

@metonym metonym force-pushed the metonym/strip-href-disabled-button branch from 99a1f0e to 2b99ebc Compare May 9, 2026 22:28
@metonym metonym force-pushed the metonym/strip-href-disabled-button branch from 2b99ebc to 4b570ca Compare May 9, 2026 22:33
@metonym metonym merged commit 2accfdc into master May 9, 2026
11 checks passed
@metonym metonym deleted the metonym/strip-href-disabled-button branch May 9, 2026 22:41
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.

1 participant