base-ui icon indicating copy to clipboard operation
base-ui copied to clipboard

JavaScript exit animations aren't properly supported

Open atomiks opened this issue 1 year ago • 2 comments

With keepMounted + AnimatePresence in (Framer) Motion, node.getAnimations() detects opacity transitions, but not transform:

This won't work, with the element unmounting instantly:

<motion.div exit={{ x: '-100%' }} />

This does however:

<motion.div exit={{ x: '-100%', opacity: 0.9999 }} />

Possible solution

A new value for keepMounted, such as keepMounted="controlled", indicating the element's mounting is being controlled by another component like AnimatePresence. This will prevent hidden from being added, and remove the disabled prop from FocusManager.

atomiks avatar Dec 18 '24 07:12 atomiks

remove the disabled prop from FocusManager

What does disabled do exactly?

vladmoroz avatar Dec 19 '24 08:12 vladmoroz

@vladmoroz makes all focus management inert with keepMounted=true. If another library is doing conditional rendering, then this is not necessary since it uses regular component mounting to enable/disable it.

atomiks avatar Dec 19 '24 09:12 atomiks