From eccaa8360c9f8f786a353472b9c2d5e7b92c87a6 Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Mon, 16 Dec 2024 23:51:33 -0800 Subject: [PATCH] Fix click area --- .../src/components/chat/AutoApproveMenu.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/webview-ui/src/components/chat/AutoApproveMenu.tsx b/webview-ui/src/components/chat/AutoApproveMenu.tsx index 6fc20a2b27..c2485455c5 100644 --- a/webview-ui/src/components/chat/AutoApproveMenu.tsx +++ b/webview-ui/src/components/chat/AutoApproveMenu.tsx @@ -139,7 +139,7 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { alignItems: "center", gap: "8px", padding: isExpanded ? "8px 0" : "8px 0 0 0", - cursor: "pointer", + cursor: !hasEnabledActions ? "pointer" : "default", }} onMouseEnter={() => { if (!hasEnabledActions) { @@ -151,7 +151,11 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { setIsHoveringCollapsibleSection(false) } }} - onClick={() => setIsExpanded((prev) => !prev)}> + onClick={() => { + if (!hasEnabledActions) { + setIsExpanded((prev) => !prev) + } + }}> { updateEnabled(!autoApprovalSettings.enabled) }} /> - + { + // to prevent this from counteracting parent + if (hasEnabledActions) { + setIsExpanded((prev) => !prev) + } + }}> Auto-approve: