Skip to content

Commit

Permalink
revamp toggle click for checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcfaul committed Mar 25, 2024
1 parent aca6b3f commit 2772aae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ class MenuToggleBase extends React.Component<MenuToggleProps> {
styles.modifiers.splitButton,
splitButtonOptions?.variant === 'action' && styles.modifiers.action
)}
onClick={onClick}
>
{splitButtonOptions?.items}
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ class MenuToggleAction extends React.Component<MenuToggleActionProps> {
<button
id={id}
className={css(styles.menuToggleButton, className)}
onClick={(evt) => {
evt.stopPropagation();
onClick(evt);
}}
onClick={onClick}
type="button"
disabled={isDisabled}
{...props}
Expand Down
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,9 +93,6 @@ class MenuToggleCheckbox extends React.Component<MenuToggleCheckboxProps, { ouia
ref={(elem) => elem && (elem.indeterminate = isChecked === null)}
aria-invalid={!isValid}
disabled={isDisabled}
onClick={(evt) => {
evt.stopPropagation();
}}
{...(defaultChecked !== undefined ? { defaultChecked } : { checked: this.calculateChecked() })}
{...getOUIAProps(
MenuToggleCheckbox.displayName,
Expand Down

0 comments on commit 2772aae

Please sign in to comment.