From 63acff06db45ad7449d42b1cdf130c8bf1ec7057 Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Sat, 2 Mar 2024 10:16:45 +0900 Subject: [PATCH] Button: Place children before the icon when `iconPosition` is "right" (#59489) * Button: Place children before the icon when `iconPosition` is "right" * Update changelog Co-authored-by: t-hamano Co-authored-by: andrewhayward Co-authored-by: tyxla Co-authored-by: ciampo Co-authored-by: mirka <0mirka00@git.wordpress.org> --- packages/components/CHANGELOG.md | 1 + packages/components/src/button/index.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index a17f1b323e0bf5..6cdde409cbd176 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -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 diff --git a/packages/components/src/button/index.tsx b/packages/components/src/button/index.tsx index 966075dd6e2b9a..a16f190e44704b 100644 --- a/packages/components/src/button/index.tsx +++ b/packages/components/src/button/index.tsx @@ -223,10 +223,10 @@ export function UnforwardedButton( ) } { text && <>{ text } } + { children } { icon && iconPosition === 'right' && ( ) } - { children } );