Skip to content

fix: keep icon button content centered#5014

Open
vivekjm wants to merge 1 commit into
callstack:mainfrom
vivekjm:fix-iconbutton-centered-content
Open

fix: keep icon button content centered#5014
vivekjm wants to merge 1 commit into
callstack:mainfrom
vivekjm:fix-iconbutton-centered-content

Conversation

@vivekjm

@vivekjm vivekjm commented Jun 28, 2026

Copy link
Copy Markdown

Summary

Fixes #4829.

This changes the IconButton ripple content from flexGrow: 1 to flex: 1 so the pressable content reliably fills the fixed-size container before centering the icon. That keeps the icon centered when callers add custom container styles such as a background color.

Test plan

  • yarn test src/components/__tests__/IconButton.test.tsx --runInBand
  • yarn lint
  • yarn typecheck
  • yarn test -u updated snapshots affected by the shared IconButton style. The full run otherwise passes except src/babel/__tests__/index.js, which cannot start because this checkout does not have lib/mappings.json generated and yarn generate-mappings points to a missing scripts/generate-mappings.ts file.

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.

Icon in IconButton not centered and cannot be centered

1 participant