From 212ae8601dcf4b39bbb162d6bc7b4b0e44a36a4f Mon Sep 17 00:00:00 2001 From: guidari Date: Mon, 8 Apr 2024 15:36:46 -0300 Subject: [PATCH 1/5] fix: added logic to set the value to empty --- packages/react/src/components/Toggle/Toggle.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/components/Toggle/Toggle.tsx b/packages/react/src/components/Toggle/Toggle.tsx index f03618b39d54..5300140464a3 100644 --- a/packages/react/src/components/Toggle/Toggle.tsx +++ b/packages/react/src/components/Toggle/Toggle.tsx @@ -191,7 +191,7 @@ export function Toggle({ role="switch" type="button" aria-checked={checked} - aria-labelledby={ariaLabelledby ?? labelId} + aria-labelledby={ariaLabelledby ?? (labelText ? labelId : '')} disabled={disabled} onClick={handleClick} /> From f42761102e4ec889575028b6a4447d1ef3506157 Mon Sep 17 00:00:00 2001 From: guidari Date: Wed, 10 Apr 2024 10:47:48 -0300 Subject: [PATCH 2/5] fix: fixed stories without a label --- packages/react/src/components/Toggle/Toggle.stories.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react/src/components/Toggle/Toggle.stories.js b/packages/react/src/components/Toggle/Toggle.stories.js index dfff27323d9d..47410ee2c5ce 100644 --- a/packages/react/src/components/Toggle/Toggle.stories.js +++ b/packages/react/src/components/Toggle/Toggle.stories.js @@ -17,7 +17,8 @@ export default { export const Default = () => ( (
External toggle label
- +
From 2b9632ca153856577c05cd969957a761e08e238f Mon Sep 17 00:00:00 2001 From: guidari Date: Wed, 10 Apr 2024 10:49:06 -0300 Subject: [PATCH 3/5] docs: changed label name --- packages/react/src/components/Toggle/Toggle.stories.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/components/Toggle/Toggle.stories.js b/packages/react/src/components/Toggle/Toggle.stories.js index 47410ee2c5ce..a181a6226d37 100644 --- a/packages/react/src/components/Toggle/Toggle.stories.js +++ b/packages/react/src/components/Toggle/Toggle.stories.js @@ -92,9 +92,9 @@ export const WithAccessibleLabels = () => (
- External toggle label + Internal aria-label toggle
- +
From 0bbb34ac417f142e8de31c160880c80e1261994d Mon Sep 17 00:00:00 2001 From: guidari Date: Wed, 10 Apr 2024 10:50:15 -0300 Subject: [PATCH 4/5] fix: removed commnets --- packages/react/src/components/Toggle/Toggle.stories.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react/src/components/Toggle/Toggle.stories.js b/packages/react/src/components/Toggle/Toggle.stories.js index a181a6226d37..6ed8692fdfd1 100644 --- a/packages/react/src/components/Toggle/Toggle.stories.js +++ b/packages/react/src/components/Toggle/Toggle.stories.js @@ -17,8 +17,7 @@ export default { export const Default = () => ( Date: Thu, 2 May 2024 15:20:44 -0300 Subject: [PATCH 5/5] fix: replace empty string with undefined --- packages/react/src/components/Toggle/Toggle.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/components/Toggle/Toggle.tsx b/packages/react/src/components/Toggle/Toggle.tsx index 5300140464a3..5b1d80f1e696 100644 --- a/packages/react/src/components/Toggle/Toggle.tsx +++ b/packages/react/src/components/Toggle/Toggle.tsx @@ -191,7 +191,7 @@ export function Toggle({ role="switch" type="button" aria-checked={checked} - aria-labelledby={ariaLabelledby ?? (labelText ? labelId : '')} + aria-labelledby={ariaLabelledby ?? (labelText ? labelId : undefined)} disabled={disabled} onClick={handleClick} />