File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ const CheckboxStandAloneComponent = (
44
44
helperText,
45
45
extraAriaDescribedBy = '' ,
46
46
screenReaderText,
47
+ ...props
47
48
} : ICheckboxStandAlone ,
48
49
ref : React . ForwardedRef < HTMLInputElement > | undefined | null
49
50
) : JSX . Element => {
@@ -139,6 +140,8 @@ const CheckboxStandAloneComponent = (
139
140
screenReaderId,
140
141
} ) }
141
142
aria-invalid = { hasError }
143
+ aria-label = { props [ 'aria-label' ] }
144
+ aria-labelledby = { props [ 'aria-labelledby' ] }
142
145
checked = { isChecked }
143
146
data-testid = { `${ dataTestId } Input` }
144
147
disabled = { isDisabled }
Original file line number Diff line number Diff line change @@ -34,11 +34,13 @@ export interface ICheckboxErrorStandAlone {
34
34
errorMessage ?: CheckboxHelperAndErrorTextType ;
35
35
}
36
36
37
+ type CheckboxAriaAttributes = Pick < React . AriaAttributes , 'aria-label' | 'aria-labelledby' > ;
38
+
37
39
/**
38
40
* @description
39
41
* interface for the checkbox standAlone
40
42
*/
41
- export interface ICheckboxStandAlone extends IInputComponent {
43
+ export interface ICheckboxStandAlone extends IInputComponent , CheckboxAriaAttributes {
42
44
dataTestId ?: string ;
43
45
state : CheckboxStateType ;
44
46
styles ?: CheckboxPropsStylesType ;
Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ const CheckboxWithLabelStandAloneComponent = <V extends string | unknown>(
51
51
styles = { styles }
52
52
>
53
53
< CheckboxControlled
54
+ aria-label = { props [ 'aria-label' ] }
55
+ aria-labelledby = { props [ 'aria-labelledby' ] }
54
56
checked = { checked }
55
57
checkedIcon = { checkedIcon }
56
58
dataTestId = { dataTestId }
You can’t perform that action at this time.
0 commit comments