Skip to content

fix(icons, input): icon vertical alignment and Addon size prop leaking#52

Merged
wangdicoder merged 5 commits intomasterfrom
fix/icon-vertical-align-and-addon-size
Mar 13, 2026
Merged

fix(icons, input): icon vertical alignment and Addon size prop leaking#52
wangdicoder merged 5 commits intomasterfrom
fix/icon-vertical-align-and-addon-size

Conversation

@wangdicoder
Copy link
Owner

Summary

  • Input.Addon: Fixed cloneElement blindly passing size="md" to all children — icons received it as an SVG dimension, rendering oversized. Now only passes size/disabled to Input, Button, and Select children.
  • Icons: Added vertical-align: middle as default style on all SVG icons so they align properly when used inline with text (instead of baseline).

Test plan

  • Verify <Addon><IconUser/></Addon> renders the icon at normal 1em size
  • Verify icons align vertically centered with adjacent inline text
  • Verify <Addon><Button>...</Button></Addon> still receives size/disabled props correctly
  • Verify icon style prop can still override verticalAlign

🤖 Generated with Claude Code

InputGroupAddon.cloneElement was blindly passing size='md' to all
children including icons, causing SVGs to render with width="md" instead
of their default "1em". Now only clones props onto Input, Button, and
Select children.
SVG icons defaulted to vertical-align: baseline, causing misalignment
when used inline with text. Now all icons default to vertical-align:
middle, which can still be overridden via the style prop.
@wangdicoder wangdicoder merged commit 927034e into master Mar 13, 2026
1 check passed
@github-actions github-actions bot mentioned this pull request Mar 13, 2026
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