diff --git a/src/components/common/wrap-card.tsx b/src/components/common/wrap-card.tsx index 3d43bc0d6..3eeecc11b 100644 --- a/src/components/common/wrap-card.tsx +++ b/src/components/common/wrap-card.tsx @@ -46,7 +46,7 @@ export const WrapCard: React.FC = ({ variant = "normal", radioValue = "", isSelected = false, - onSelect = () => {}, + onSelect, ...cardProps }) => { const { config } = useLauncherConfig(); @@ -95,20 +95,18 @@ export const WrapCard: React.FC = ({ return ( {variant === "radio" && ( - + )} {renderContent()} @@ -165,7 +163,7 @@ export const WrapCardGroup: React.FC = ({ initialIsOpen={props.initialIsOpen} > {items.length > 0 && ( - + {/* add mb to show last row cards' bottom shadow */} {items.map((item, index) => { const validColSpan = Math.max(1, Math.floor(item.colSpan || 1)); diff --git a/src/components/instance-menu.tsx b/src/components/instance-menu.tsx index 0c9a023cc..529fceab9 100644 --- a/src/components/instance-menu.tsx +++ b/src/components/instance-menu.tsx @@ -70,6 +70,7 @@ export const InstanceMenu: React.FC = ({ variant="ghost" aria-label="operations" icon={} + onClick={(e) => e.stopPropagation()} /> @@ -78,7 +79,10 @@ export const InstanceMenu: React.FC = ({ key={item.label} fontSize="xs" color={item.danger ? "red.500" : "inherit"} - onClick={item.onClick} + onClick={(e) => { + e.stopPropagation(); + item.onClick(); + }} > @@ -97,7 +101,10 @@ export const InstanceMenu: React.FC = ({ icon={item.icon} label={item.label} colorScheme={item.danger ? "red" : "gray"} - onClick={item.onClick} + onClick={(e) => { + e.stopPropagation(); + item.onClick(); + }} /> ))} diff --git a/src/components/instances-view.tsx b/src/components/instances-view.tsx index 88ef62bfb..53729dd15 100644 --- a/src/components/instances-view.tsx +++ b/src/components/instances-view.tsx @@ -69,17 +69,14 @@ const InstancesView: React.FC = ({ /> ), - ...(withMenu - ? {} - : { - isFullClickZone: true, - onClick: () => handleUpdateSelectedInstance(instance), - }), + isFullClickZone: true, + onClick: () => handleUpdateSelectedInstance(instance), children: withMenu ? ( ) : ( <> ), + isChildrenIndependent: withMenu, })); const gridItems = instances.map((instance) => ({ diff --git a/src/components/player-menu.tsx b/src/components/player-menu.tsx index 0c3681d8d..24b3929a2 100644 --- a/src/components/player-menu.tsx +++ b/src/components/player-menu.tsx @@ -164,6 +164,7 @@ export const PlayerMenu: React.FC = ({ variant="ghost" aria-label="operations" icon={} + onClick={(e) => e.stopPropagation()} /> @@ -172,7 +173,10 @@ export const PlayerMenu: React.FC = ({ key={item.label} fontSize="xs" color={item.danger ? "red.500" : "inherit"} - onClick={item.onClick} + onClick={(e) => { + e.stopPropagation(); + item.onClick(); + }} > @@ -191,7 +195,10 @@ export const PlayerMenu: React.FC = ({ icon={item.icon} label={item.label} colorScheme={item.danger ? "red" : "gray"} - onClick={item.onClick} + onClick={(e) => { + e.stopPropagation(); + item.onClick(); + }} isLoading={item.isLoading} /> ))} diff --git a/src/components/players-view.tsx b/src/components/players-view.tsx index 87ecdcb71..9e6b8a4b4 100644 --- a/src/components/players-view.tsx +++ b/src/components/players-view.tsx @@ -59,17 +59,14 @@ const PlayersView: React.FC = ({ /> ), - ...(withMenu - ? {} - : { - isFullClickZone: true, - onClick: () => handleUpdateSelectedPlayer(player.id), - }), + isFullClickZone: true, + onClick: () => handleUpdateSelectedPlayer(player.id), children: withMenu ? ( ) : ( <> ), + isChildrenIndependent: withMenu, })); const gridItems = players.map((player) => ({