Replies: 2 comments
-
|
Root Cause: Fix: Use the <Transition show={isOpen}>
<Transition.Child
enter="transition-opacity duration-300"
enterFrom="opacity-0"
enterTo="opacity-80" // During transition
entered="opacity-80" // After transition completes
>
Content
</Transition.Child>
</Transition>Alternative: Data attributes (v2.1+) <Transition show={isOpen}>
<div className="transition duration-300 data-[closed]:opacity-0">
Content
</div>
</Transition>Why: With multiple Source: |
Beta Was this translation helpful? Give feedback.
-
|
While the "entered" prop sort of solves the issue, its not 100%. This is also a deprecated prop, which means that its not meant to be used. I have not tested using Data attributes, but according to the documentation, the reason why we SHOULD be able to use enterTO and leaveFrom is exactly this (atleast to my understanding of the updated docs) as={Fragment}
enter="ease-out duration-300"
enterFrom="opacity-0"
enterTo="opacity-75"
leave="ease-in duration-200"
leaveFrom="opacity-75"
leaveTo="opacity-0"This should in theory work, but is wonky with the animations. With "entered" it stops at 75 atleast, but when the "close" animation is triggered, it blinks to 100%, so it doesn't look good. Im pretty sure its just bugged that the classes doesn't actually work the way they are intended. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The property on TransitionChild: enterTo="opacity-80" does not respect this in multi transition. Old deprecated: entered="opacity-80" must be used to not go to 100 opacity after transition ends.
Beta Was this translation helpful? Give feedback.
All reactions