From 837aa5a2ea4fd0f05268c1c93b44adc5bdf83e40 Mon Sep 17 00:00:00 2001 From: Nolann Biron Date: 2025年10月19日 20:33:00 +0200 Subject: [PATCH 1/2] Fix ToggeableLinkItem display --- .changeset/quiet-icons-deny.md | 5 +++++ .../src/components/TableOfContents/ToggleableLinkItem.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/quiet-icons-deny.md diff --git a/.changeset/quiet-icons-deny.md b/.changeset/quiet-icons-deny.md new file mode 100644 index 0000000000..9345f6b8f3 --- /dev/null +++ b/.changeset/quiet-icons-deny.md @@ -0,0 +1,5 @@ +--- +'gitbook': patch +--- + +Fix ToggeableLinkItem display diff --git a/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx b/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx index 5656ba3cd5..8b60644c9a 100644 --- a/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx +++ b/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx @@ -180,7 +180,7 @@ function Toggler(props: { const show = { opacity: 1, height: 'auto', - display: 'inherit', + display: 'contents', }; const hide = { opacity: 0, From 5c42fc367ce5fac866927edf3d1f5683e258f1f1 Mon Sep 17 00:00:00 2001 From: Zeno Kapitein Date: 2025年10月20日 17:15:47 +0200 Subject: [PATCH 2/2] Update ToggleableLinkItem.tsx --- .../TableOfContents/ToggleableLinkItem.tsx | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx b/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx index 8b60644c9a..4d222da04f 100644 --- a/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx +++ b/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx @@ -1,7 +1,7 @@ 'use client'; import { Icon } from '@gitbook/icons'; -import { motion } from 'motion/react'; +import { AnimatePresence, motion } from 'motion/react'; import React, { useRef } from 'react'; import { tcls } from '@/lib/tailwind'; @@ -180,14 +180,10 @@ function Toggler(props: { const show = { opacity: 1, height: 'auto', - display: 'contents', }; const hide = { opacity: 0, height: 0, - transitionEnd: { - display: 'none', - }, }; function Descendants(props: { @@ -196,12 +192,17 @@ function Descendants(props: { }) { const { isVisible, children } = props; return ( - - {children} - + + {isVisible ? ( + + {children} + + ) : null} + ); }

AltStyle によって変換されたページ (->オリジナル) /