From d58f52203a14ad966c96a2ee48bbe4d51e84cd02 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Tue, 8 Mar 2022 17:29:40 +0800 Subject: [PATCH] =?UTF-8?q?HEXO=20=E5=AF=BC=E8=88=AA=E6=A0=8F=E6=B7=A1?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/Hexo/components/Collapse.js | 4 ++++ themes/Hexo/components/HeaderArticle.js | 2 +- themes/Hexo/components/TopNav.js | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/themes/Hexo/components/Collapse.js b/themes/Hexo/components/Collapse.js index 8af6f100..769ac602 100644 --- a/themes/Hexo/components/Collapse.js +++ b/themes/Hexo/components/Collapse.js @@ -5,6 +5,10 @@ const Collapse = props => { const collapseRef = useRef(null) const collapseSection = element => { const sectionHeight = element.scrollHeight + const currentHeight = element.style.height + if (currentHeight === '0px') { + return + } requestAnimationFrame(function () { element.style.height = sectionHeight + 'px' requestAnimationFrame(function () { diff --git a/themes/Hexo/components/HeaderArticle.js b/themes/Hexo/components/HeaderArticle.js index 5476b686..ffb43bd7 100644 --- a/themes/Hexo/components/HeaderArticle.js +++ b/themes/Hexo/components/HeaderArticle.js @@ -36,7 +36,7 @@ export default function HeaderArticle ({ post }) { return (