From 702a0eaecd692a481d2103b9d2a9b4de7bfca78e Mon Sep 17 00:00:00 2001 From: Moritz Mechelk Date: Fri, 9 Jan 2026 23:07:22 +0100 Subject: [PATCH 1/2] fix: early return from slideDown if duration is zero --- src/ts/util/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ts/util/index.ts b/src/ts/util/index.ts index 47a99e626dc..683e1237dcc 100644 --- a/src/ts/util/index.ts +++ b/src/ts/util/index.ts @@ -85,6 +85,11 @@ const slideDown = (target: HTMLElement, duration = 500) => { } target.style.display = display + + if (duration === 0) { + return; + } + const height = target.offsetHeight target.style.overflow = 'hidden' target.style.height = '0' From 7d69692069c80c26f12999c14a311c3d1a42f275 Mon Sep 17 00:00:00 2001 From: Moritz Mechelk Date: Fri, 16 Jan 2026 12:53:24 +0100 Subject: [PATCH 2/2] fix: early return from slideUp if duration is less than 1 --- src/ts/util/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ts/util/index.ts b/src/ts/util/index.ts index 683e1237dcc..4dea4c25484 100644 --- a/src/ts/util/index.ts +++ b/src/ts/util/index.ts @@ -48,6 +48,11 @@ const safePropertyAccess = (obj: Record, property: string): unk /* SLIDE UP */ const slideUp = (target: HTMLElement, duration = 500) => { + if (duration <= 1) { + target.style.display = 'none' + return + } + target.style.transitionProperty = 'height, margin, padding' target.style.transitionDuration = `${duration}ms` target.style.boxSizing = 'border-box' @@ -86,8 +91,8 @@ const slideDown = (target: HTMLElement, duration = 500) => { target.style.display = display - if (duration === 0) { - return; + if (duration <= 1) { + return } const height = target.offsetHeight