Open mj12albert opened 1 month ago
This seems back-to-front to me. Wouldn't it be better—and more in-line with our other components—if the panel contents unmounted by default, and then you can use the keepMounted
prop if you need it?
cc @michaldudak
I'd name the prop keepMounted
for sure. As for its default value, I don't have a strong opinion, but I lean towards making it consistent with other components (so false
).
@colmtuite I agree with naming this as keepMounted
instead
I think it makes sense for the default for this to be true
, because generally browsers implement the behavior of the hidden
attribute with CSS display: none
, which doesn't remove the Panel (and contents) from the DOM
And for other components, keepMounted
is needed for animations using Framer; while for Collapsible
, it would be for performance, e.g. if you have a lot of Collapsible
s with heavy components in the Panel as @oliviertassinari mentioned, what do you think?
Follow up to https://github.com/mui/base-ui/pull/577#pullrequestreview-2345745521