From 931ba285bb6d6cd02476580545eb01009c4d3c30 Mon Sep 17 00:00:00 2001 From: tjtanjin Date: Wed, 20 Nov 2024 14:02:32 -0800 Subject: [PATCH] fix: Fix zindex for embedded chatbots --- src/components/ChatBotContainer.css | 1 - src/components/ChatBotContainer.tsx | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/ChatBotContainer.css b/src/components/ChatBotContainer.css index 7ae9d9f..d6b65b0 100644 --- a/src/components/ChatBotContainer.css +++ b/src/components/ChatBotContainer.css @@ -22,7 +22,6 @@ flex-direction: column; width: 375px; height: 550px; - z-index: 10000; } .rcb-window-embedded .rcb-chat-window { diff --git a/src/components/ChatBotContainer.tsx b/src/components/ChatBotContainer.tsx index 9e32f43..4cdea5e 100644 --- a/src/components/ChatBotContainer.tsx +++ b/src/components/ChatBotContainer.tsx @@ -91,6 +91,15 @@ const ChatBotContainer = ({ height: `${viewportHeight}px`, } } + + // if not embedded, add z-index + if (!settings.general?.embedded) { + return { + ...styles.chatWindowStyle, + zIndex: 10000, + }; + } + return styles.chatWindowStyle; }