Skip to content

Commit

Permalink
storage: Stop kebab toggles from bubbling
Browse files Browse the repository at this point in the history
This would otherwise interfere with clicks on table rows.
  • Loading branch information
mvollmer committed Aug 25, 2023
1 parent 979f696 commit bf64b22
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/storaged/storage-controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,17 @@ export const StorageBarMenu = ({ label, isKebab, onlyNarrow, menuItems }) => {
if (!client.superuser.allowed)
return null;

function onToggle(event, isOpen) {
event.stopPropagation();
setIsOpen(isOpen);
}

let toggle;
if (isKebab)
toggle = <KebabToggle onToggle={(_, isOpen) => setIsOpen(isOpen)} />;
toggle = <KebabToggle onToggle={onToggle} />;
else
toggle = <DropdownToggle className="pf-m-primary" toggleIndicator={null}
onToggle={(_, isOpen) => setIsOpen(isOpen)} aria-label={label}>
onToggle={onToggle} aria-label={label}>
<BarsIcon color="white" />
</DropdownToggle>;

Expand Down

0 comments on commit bf64b22

Please sign in to comment.