Skip to content

Commit

Permalink
fix(MenuToggle): fix indeterminate checkbox error, toggle click behav…
Browse files Browse the repository at this point in the history
…ior (#10066)

* fix(MenuToggle): fix indeterminate checkbox error, toggle click behavior

* revamp toggle click for checkbox
  • Loading branch information
kmcfaul authored Mar 26, 2024
1 parent b1b8706 commit 132939e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class MenuToggleCheckbox extends React.Component<MenuToggleCheckboxProps, { ouia
</span>
);
return (
<label className={css(styles.check, !children && styles.modifiers.standalone, className)} htmlFor={id}>
<label className={css(styles.check, !children && styles.modifiers.standalone, className)}>
<input
className={css(styles.checkInput)}
{...(this.calculateChecked() !== undefined && { onChange: this.handleChange })}
Expand All @@ -93,7 +93,7 @@ class MenuToggleCheckbox extends React.Component<MenuToggleCheckboxProps, { ouia
ref={(elem) => elem && (elem.indeterminate = isChecked === null)}
aria-invalid={!isValid}
disabled={isDisabled}
{...(defaultChecked !== undefined ? { defaultChecked } : { checked: isChecked })}
{...(defaultChecked !== undefined ? { defaultChecked } : { checked: this.calculateChecked() })}
{...getOUIAProps(
MenuToggleCheckbox.displayName,
ouiaId !== undefined ? ouiaId : this.state.ouiaStateId,
Expand Down

0 comments on commit 132939e

Please sign in to comment.