From 860ccc0a29b0f217b3b44c15a0db9e43530c2f70 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 13 Oct 2022 09:31:17 +0200 Subject: [PATCH] feat(DrawerList): animate max-height when changed during scrolling --- .../__tests__/__snapshots__/DrawerList.test.js.snap | 4 ++++ .../src/fragments/drawer-list/style/_drawer-list.scss | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/packages/dnb-eufemia/src/fragments/drawer-list/__tests__/__snapshots__/DrawerList.test.js.snap b/packages/dnb-eufemia/src/fragments/drawer-list/__tests__/__snapshots__/DrawerList.test.js.snap index f0b4313eb7b..b1102227dc1 100644 --- a/packages/dnb-eufemia/src/fragments/drawer-list/__tests__/__snapshots__/DrawerList.test.js.snap +++ b/packages/dnb-eufemia/src/fragments/drawer-list/__tests__/__snapshots__/DrawerList.test.js.snap @@ -1149,6 +1149,7 @@ exports[`DrawerList scss have to match snapshot 1`] = ` .dnb-drawer-list--scroll .dnb-drawer-list__options { min-height: 2rem; max-height: 70vh; + transition: max-height 300ms var(--easing-default); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; @@ -1159,6 +1160,9 @@ exports[`DrawerList scss have to match snapshot 1`] = ` scroll-behavior: smooth; } html[data-visual-test] .dnb-drawer-list--scroll .dnb-drawer-list__options { scroll-behavior: auto !important; } + html[data-visual-test] .dnb-drawer-list--scroll .dnb-drawer-list__options, + .dnb-drawer-list--scroll.dnb-drawer-list--no-animation .dnb-drawer-list__options { + animation-duration: 1ms !important; } .dnb-drawer-list--opened .dnb-drawer-list__options { scroll-behavior: smooth; } .dnb-drawer-list--no-scroll-animation .dnb-drawer-list__options { diff --git a/packages/dnb-eufemia/src/fragments/drawer-list/style/_drawer-list.scss b/packages/dnb-eufemia/src/fragments/drawer-list/style/_drawer-list.scss index 04102e4861f..68b9015c9db 100644 --- a/packages/dnb-eufemia/src/fragments/drawer-list/style/_drawer-list.scss +++ b/packages/dnb-eufemia/src/fragments/drawer-list/style/_drawer-list.scss @@ -137,9 +137,14 @@ &--scroll &__options { min-height: 2rem; max-height: 70vh; + transition: max-height 300ms var(--easing-default); @include scrollY(auto); } + html[data-visual-test] &--scroll &__options, + &--scroll#{&}--no-animation &__options { + animation-duration: 1ms !important; + } &--opened &__options { scroll-behavior: smooth; }