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

Button: Place children before the icon when iconPosition is "right" #59489

Merged
merged 2 commits into from Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Expand Up @@ -7,6 +7,7 @@
- `Tooltip`: Explicitly set system font to avoid CSS bleed ([#59307](https://github.com/WordPress/gutenberg/pull/59307)).
- `HStack`, `VStack`: Stop passing invalid props to underlying element ([#59416](https://github.com/WordPress/gutenberg/pull/59416)).
- `Button`: Fix focus outline in disabled primary variant ([#59391](https://github.com/WordPress/gutenberg/pull/59391)).
- `Button`: Place `children` before the icon when `iconPosition` is `right` ([#59489](https://github.com/WordPress/gutenberg/pull/59489)).

### Internal

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/button/index.tsx
Expand Up @@ -223,10 +223,10 @@ export function UnforwardedButton(
<Icon icon={ icon } size={ iconSize } />
) }
{ text && <>{ text }</> }
{ children }
{ icon && iconPosition === 'right' && (
<Icon icon={ icon } size={ iconSize } />
) }
{ children }
</>
);

Expand Down