From 55d4889d3713fb669c712ecc102c48ed5ba40336 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Mon, 9 Sep 2024 21:11:36 +0300 Subject: [PATCH] Fixed #6365 - animate-slidedown fails when a Tailwind prefix is used --- packages/primevue/src/styleclass/StyleClass.d.ts | 4 ++++ packages/primevue/src/styleclass/StyleClass.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/primevue/src/styleclass/StyleClass.d.ts b/packages/primevue/src/styleclass/StyleClass.d.ts index a457d73b2..34d3f9a64 100644 --- a/packages/primevue/src/styleclass/StyleClass.d.ts +++ b/packages/primevue/src/styleclass/StyleClass.d.ts @@ -44,6 +44,10 @@ export interface StyleClassOptions { * Style class to add when leave animation is completed. */ leaveToClass?: string | undefined; + /** + * Special class name to hide an element, only used in slide animation. + */ + hiddenClass?: string | undefined; /** * Whether to trigger leave animation when outside of the element is clicked. * @defaultValue false diff --git a/packages/primevue/src/styleclass/StyleClass.js b/packages/primevue/src/styleclass/StyleClass.js index ec079e1ac..5eec15b36 100644 --- a/packages/primevue/src/styleclass/StyleClass.js +++ b/packages/primevue/src/styleclass/StyleClass.js @@ -43,9 +43,9 @@ const StyleClass = BaseStyleClass.extend('styleclass', { if (binding.value.enterActiveClass.includes('slidedown')) { target.style.height = '0px'; - removeClass(target, 'hidden'); + removeClass(target, binding.value.hiddenClass || binding.value.enterFromClass); target.style.maxHeight = target.scrollHeight + 'px'; - addClass(target, 'hidden'); + addClass(target, binding.value.hiddenClass || binding.value.enterActiveClass); target.style.height = ''; }