From 87fd234d551dd5bb1a05c42ff212360bb27e4989 Mon Sep 17 00:00:00 2001 From: Tomek Date: Mon, 17 Aug 2026 14:55:09 +0200 Subject: [PATCH] Fix dropdown icon rotation by reading dropdown open state (#4503) Co-authored-by: Claude Haiku 4.5 --- .../PageActions/PageActionsDropdown.tsx | 18 ++++++++++++++++-- .../src/components/primitives/DropdownMenu.tsx | 7 +++++++ .../components/primitives/ToggleChevron.tsx | 15 ++++++++++++++- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/packages/gitbook/src/components/PageActions/PageActionsDropdown.tsx b/packages/gitbook/src/components/PageActions/PageActionsDropdown.tsx index a18a1c4db..ec85fad98 100644 --- a/packages/gitbook/src/components/PageActions/PageActionsDropdown.tsx +++ b/packages/gitbook/src/components/PageActions/PageActionsDropdown.tsx @@ -24,8 +24,13 @@ import { type PageActionAssistantContext, } from './PageActions'; import { Button, ButtonGroup } from '@/components/primitives/Button'; -import { DropdownMenu, DropdownMenuSeparator } from '@/components/primitives/DropdownMenu'; +import { + DropdownMenu, + DropdownMenuSeparator, + useDropdownMenuOpen, +} from '@/components/primitives/DropdownMenu'; import { tString, useLanguage } from '@/intl/client'; +import type { ClassValue } from '@/lib/tailwind'; /** * Type of a built-in page action that can be displayed in the page actions menu. @@ -137,7 +142,7 @@ export function PageActionsDropdown(props: PageActionsDropdownProps) { className="!min-w-60 max-w-max" button={