Skip to content

Commit

Permalink
Button: Place children before the icon when iconPosition is "right" (
Browse files Browse the repository at this point in the history
…#59489)

* Button: Place children before the icon when `iconPosition` is "right"

* Update changelog

Co-authored-by: t-hamano <[email protected]>
Co-authored-by: andrewhayward <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: mirka <[email protected]>
  • Loading branch information
6 people authored Mar 2, 2024
1 parent 0b417ca commit 63acff0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 63acff0

Please sign in to comment.