Skip to content

Commit

Permalink
fix(RHINENG-8416): Do not open menu on checkbox click
Browse files Browse the repository at this point in the history
  • Loading branch information
LightOfHeaven1994 committed Oct 22, 2024
1 parent 6bbd0a0 commit dacd72a
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions packages/components/src/BulkSelect/BulkSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,18 @@ const BulkSelect: React.FunctionComponent<BulkSelectProps> = ({
toggleProps?.children
) : (
<Fragment key="split-checkbox">
{hasError ? (
<MenuToggleCheckbox
id={id ? `${id}-toggle-checkbox` : 'toggle-checkbox'}
aria-label="Select all"
onChange={onSelect}
isChecked={checked}
ouiaId={checkboxOuiaId ?? 'BulkSelectCheckbox'}
/>
) : (
<MenuToggleCheckbox
id={id ? `${id}-toggle-checkbox` : 'toggle-checkbox'}
aria-label="Select all"
onChange={onSelect}
isChecked={checked}
ouiaId={checkboxOuiaId ?? 'BulkSelectCheckbox'}
>
{count ? `${count} selected` : ''}
</MenuToggleCheckbox>
)}
<MenuToggleCheckbox
id={id ? `${id}-toggle-checkbox` : 'toggle-checkbox'}
aria-label="Select all"
onChange={(checked, event) => {
setIsOpen(false);
onSelect?.(checked, event);
}}
isChecked={checked}
ouiaId={checkboxOuiaId ?? 'BulkSelectCheckbox'}
>
{!hasError && count ? `${count} selected` : ''}
</MenuToggleCheckbox>
</Fragment>
)}
</MenuToggle>
Expand Down

0 comments on commit dacd72a

Please sign in to comment.