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 <wildworks@git.wordpress.org>
Co-authored-by: andrewhayward <andrewhayward@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
  • Loading branch information
6 people committed 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
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

0 comments on commit 63acff0

Please sign in to comment.