From 7d59b0f5b8380f541bc2f1da08ac0136217e775d Mon Sep 17 00:00:00 2001 From: meetup-oleksandr-dudiuk Date: Fri, 20 Oct 2023 16:19:04 +0300 Subject: [PATCH] Pro Dashboard Programmatic label does not [sc-74049] --- src/forms/Checkbox.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/forms/Checkbox.jsx b/src/forms/Checkbox.jsx index f988f4a4..31d5dfe4 100644 --- a/src/forms/Checkbox.jsx +++ b/src/forms/Checkbox.jsx @@ -69,6 +69,7 @@ export class Checkbox extends React.PureComponent { name, value = '', className: customStyle, + ariaLabel, ...other } = this.props; @@ -102,7 +103,8 @@ export class Checkbox extends React.PureComponent { readOnly={!this.onChange || disabled} name={name} aria-label={ - typeof label === 'string' ? `${label} - checkbox` : 'checkbox' + ariaLabel || + (typeof label === 'string' ? `${label} - checkbox` : 'checkbox') } value={`${value}`} /> @@ -133,6 +135,9 @@ Checkbox.propTypes = { /** Callback that happens when the input changes */ onChange: PropTypes.func, + + /** The `ariaLabel` attribute for the input */ + ariaLabel: PropTypes.string, }; Checkbox.defaultProps = {