π OpenHands: AI-Driven Development
Fix nested MCP marketplace card button (#1064)
Devin4e861b99c7a2
diff --git a/src/components/features/mcp-page/marketplace-card.tsx b/src/components/features/mcp-page/marketplace-card.tsxindex bbcd01f0ca..3b4a1f7beb 100644--- a/src/components/features/mcp-page/marketplace-card.tsx+++ b/src/components/features/mcp-page/marketplace-card.tsx@@ -1,3 +1,4 @@+import type { KeyboardEvent } from "react";import { I18nKey } from "#/i18n/declaration";import type { IntegrationCatalogEntry as MarketplaceEntry } from "@openhands/extensions/integrations";import { McpLogoBadge } from "#/components/features/mcp-logo-badge";@@ -34,10 +35,23 @@ export function MarketplaceCard({}})();+ const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {+ if (event.target !== event.currentTarget) {+ return;+ }++ if (event.key === "Enter" || event.key === " ") {+ event.preventDefault();+ onClick();+ }+ };+return (- <button- type="button"+ <div+ role="button"+ tabIndex={0}onClick={onClick}+ onKeyDown={handleKeyDown}data-testid={`mcp-marketplace-card-${entry.id}`}className={cn("flex min-h-[132px] flex-col overflow-hidden p-4 text-left",@@ -72,6 +86,6 @@ export function MarketplaceCard({</p></div></div>- </button>+ </div>);}