From e0bd2a79b0c424e78d872973197070409d78766c Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 29 Jan 2025 20:50:51 +0200 Subject: [PATCH] docs: fix overflowing content on small devices (#11219) --- .../docs-ui/src/components/AiAssistant/ChatWindow/index.tsx | 3 ++- www/packages/docs-ui/src/providers/Layout/index.tsx | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/www/packages/docs-ui/src/components/AiAssistant/ChatWindow/index.tsx b/www/packages/docs-ui/src/components/AiAssistant/ChatWindow/index.tsx index 86390a866f..c60e5e1c5d 100644 --- a/www/packages/docs-ui/src/components/AiAssistant/ChatWindow/index.tsx +++ b/www/packages/docs-ui/src/components/AiAssistant/ChatWindow/index.tsx @@ -152,7 +152,8 @@ export const AiAssistantChatWindow = () => { "shadow-elevation-modal dark:shadow-elevation-modal-dark", "bg-medusa-bg-base rounded-docs_DEFAULT overflow-x-hidden", "flex-col justify-between m-docs_0.25 max-w-ai-assistant", - chatOpened && ["!right-0"] + chatOpened && ["!right-0"], + !chatOpened && ["!fixed"] )} style={{ height, diff --git a/www/packages/docs-ui/src/providers/Layout/index.tsx b/www/packages/docs-ui/src/providers/Layout/index.tsx index 5df816bbb5..dc677e6e6c 100644 --- a/www/packages/docs-ui/src/providers/Layout/index.tsx +++ b/www/packages/docs-ui/src/providers/Layout/index.tsx @@ -24,11 +24,7 @@ export const LayoutProvider = ({ const [showCollapsedNavbar, setShowCollapsedNavbar] = useState(false) useResizeObserver(mainContentRef as React.RefObject, () => { - if (disableResizeObserver) { - setShowCollapsedNavbar(false) - return - } - if (window.innerWidth < 992) { + if (disableResizeObserver || window.innerWidth < 992) { setShowCollapsedNavbar(false) return }