From b72eb07a5e05874fba8d80d5b875fb9964c1e6ab Mon Sep 17 00:00:00 2001 From: chad1008 <13856531+chad1008@users.noreply.github.com> Date: Mon, 18 Dec 2023 16:49:31 -0500 Subject: [PATCH 1/2] pass disabled prop to `Button` --- packages/components/src/form-token-field/token.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/components/src/form-token-field/token.tsx b/packages/components/src/form-token-field/token.tsx index e5633aa3b75cf0..745a6d485df9b8 100644 --- a/packages/components/src/form-token-field/token.tsx +++ b/packages/components/src/form-token-field/token.tsx @@ -74,6 +74,7 @@ export default function Token( { className="components-form-token-field__remove-token" icon={ closeSmall } onClick={ ! disabled ? onClick : undefined } + disabled={ disabled } label={ messages.remove } aria-describedby={ `components-form-token-field__token-text-${ instanceId }` } /> From 90ab2906c21702caa691a8fc82f03a4e8adb2a8e Mon Sep 17 00:00:00 2001 From: chad1008 <13856531+chad1008@users.noreply.github.com> Date: Mon, 18 Dec 2023 16:56:38 -0500 Subject: [PATCH 2/2] changelog --- packages/components/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 970341765bfe69..0f0197c5d164b0 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -5,6 +5,7 @@ ### Bug Fix - `PaletteEdit`: Consider digits when generating kebab-cased slug ([#56713](https://github.com/WordPress/gutenberg/pull/56713)). +- `FormTokenField`: Prevent focus being passed to internal buttons when component is disabled ([#57187](https://github.com/WordPress/gutenberg/pull/57187)). ### Experimental