diff --git a/src/components/InputGroup/InputGroup.jsx b/src/components/InputGroup/InputGroup.jsx index ef5e7b9f..2b9cc9d5 100644 --- a/src/components/InputGroup/InputGroup.jsx +++ b/src/components/InputGroup/InputGroup.jsx @@ -69,16 +69,15 @@ export const InputGroup = ({ > {label} -
- {label} -
+ {isLabelVisible && ( +
+ {label} +
+ )}
{label} -
- {label} -
+ {isLabelVisible && ( +
+ {label} +
+ )}
{ diff --git a/src/components/Radio/Radio.scss b/src/components/Radio/Radio.scss index b36b3a09..d102dfec 100644 --- a/src/components/Radio/Radio.scss +++ b/src/components/Radio/Radio.scss @@ -64,11 +64,6 @@ @include variants.validation(warning); } -// Invisible label -.isLabelHidden { - @include accessibility.hide-text(); -} - // Layouts .isRootLayoutVertical, .isRootLayoutHorizontal { diff --git a/tests/propTests/isLabelVisibleTest.js b/tests/propTests/isLabelVisibleTest.js index 91afe220..ade8a8a1 100644 --- a/tests/propTests/isLabelVisibleTest.js +++ b/tests/propTests/isLabelVisibleTest.js @@ -22,7 +22,7 @@ export const isLabelVisibleTest = (HtmlTag = 'label') => ( }, (rootElement) => { if (HtmlTag === 'legend') { - expect(within(rootElement).getByTestId('id__displayLabel')).toHaveClass('isLabelHidden'); + expect(within(rootElement).queryByTestId('id__displayLabel')).not.toBeInTheDocument(); } else { expect(within(rootElement).getByText('label')).toHaveClass('isLabelHidden'); }