Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pro Dashboard Programmatic label does not [sc-74049] #894

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/forms/Checkbox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class Checkbox extends React.PureComponent {
name,
value = '',
className: customStyle,
ariaLabel,
...other
} = this.props;

Expand Down Expand Up @@ -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}`}
/>
Expand Down Expand Up @@ -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 = {
Expand Down
Loading