Skip to content

The open alternative to Salesforce, designed for AI.

fix: stop event propagation when removing file in AI chat preview (#18779)

victorjzq26139ee463b4
diff --git a/packages/twenty-front/src/modules/ai/components/internal/AgentChatFilePreview.tsx b/packages/twenty-front/src/modules/ai/components/internal/AgentChatFilePreview.tsx
index 214d9a63419..df563e032f4 100644
--- a/packages/twenty-front/src/modules/ai/components/internal/AgentChatFilePreview.tsx
+++ b/packages/twenty-front/src/modules/ai/components/internal/AgentChatFilePreview.tsx
@@ -72,11 +72,13 @@ export const AgentChatFilePreview = ({
);
const rightComponent = onRemove ? (
- <AvatarOrIcon
- Icon={IconX}
- IconColor={theme.font.color.secondary}
- onClick={onRemove}
- />
+ <div onClick={(e) => e.stopPropagation()}>
+ <AvatarOrIcon
+ Icon={IconX}
+ IconColor={theme.font.color.secondary}
+ onClick={onRemove}
+ />
+ </div>
) : undefined;
const hasRightDivider = isDefined(onRemove);