Why do .collapse components transition the width/height properties? #34771
Unanswered
Rabadash8820
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been trying to get a side-menu working with the new
.collapse-horizontal
component, but I'm having some trouble getting a smooth expand transition. The only similar issue that I could find here was #33823, which was closed without an answer. From googling around, I found these two articles that essentially start with the same insight: animating anything other than CSStransform
oropacity
is gonna cause a lot of reflows in the browser and make animations slow/choppy. The second article (from 2020) specifically recommends against animatingwidth
andheight
. I was surprised to find, then, that the Bootstrap collapse classes are doing just this:So my question is, why doesn't Bootstrap transition the
transform
in some way (presumablyscale
)? If this was a conscious decision, can someone explain why the side menu in the JSFiddle in #33823 appears choppy upon expanding, and/or how to get around this? It's basically the same issue that I'm seeing...Beta Was this translation helpful? Give feedback.
All reactions