You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an accordion that animates height between auto and 0 when expanding/collapsing. In addition to height animation, we switch the display property between block and none in order to make sure the content is hidden also from screen readers.
However, when upgrading our framer-motion dependency, I noticed this behavior is broken with versions >= v11.2.0. When expanding the accordion, the height jumps instantly to auto instead of animating from 0. If the display property is not animated at the same time, the height animation works correctly. On version v11.1.9, the animation still works as expected when applying the display: none in the transitionEnd (in effect transitionEnd: { display: "none" }).
CodeSandbox
Please check this CodeSandbox which is modified version of dev/react/src/examples/Animation-display-visibility.tsx example, which illustrates the issue.
Open the CodeSandbox and open DevTools console to see the console.log output.
Click on the toggle button to see how height animates from auto to 0.
Click again to see how height instantly jumps from 0 to auto without animating.
Repeat steps with the second example to see how height is animated when display property is not animated.
The text was updated successfully, but these errors were encountered:
Description
We have an accordion that animates
height
betweenauto
and0
when expanding/collapsing. In addition toheight
animation, we switch thedisplay
property betweenblock
andnone
in order to make sure the content is hidden also from screen readers.However, when upgrading our
framer-motion
dependency, I noticed this behavior is broken with versions>= v11.2.0
. When expanding the accordion, theheight
jumps instantly toauto
instead of animating from0
. If thedisplay
property is not animated at the same time, theheight
animation works correctly. On versionv11.1.9
, the animation still works as expected when applying thedisplay: none
in thetransitionEnd
(in effecttransitionEnd: { display: "none" }
).CodeSandbox
Please check this CodeSandbox which is modified version of
dev/react/src/examples/Animation-display-visibility.tsx
example, which illustrates the issue.console.log
output.height
animates fromauto
to0
.height
instantly jumps from0
toauto
without animating.height
is animated whendisplay
property is not animated.The text was updated successfully, but these errors were encountered: