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
This may just be a CSS limitation, but I’d appreciate any direction or advice on how to approach this and how to know these kind of things are not related to motion-v.
Vite.App.-.Google.Chrome.2026-01-12.13-57-13.mp4
1. Describe what is happening
I want to display modals in a somewhat unique way: the last opened modal should be on its own, while the rest are stacked on the left. I thought I was being clever by using the stacking “trick” with display: grid, but this causes things to look bad when closing the last/right modal. I feel like this should just work, because with display: flex everything behaves as expected when closing modals.
In my example, I have:
A modal-container that displays the modals from the openModal array
A button to add new modals
Each modal has a close button
With display: flex on the modal-container:
The animation for adding modals is correct ✅
The animation for removing modals is correct ✅
The overall layout is wrong (I want stacked modals) ❌
This may just be a CSS limitation, but I’d appreciate any direction or advice on how to approach this and how to know these kind of things are not related to
motion-v.Vite.App.-.Google.Chrome.2026-01-12.13-57-13.mp4
1. Describe what is happening
I want to display modals in a somewhat unique way: the last opened modal should be on its own, while the rest are stacked on the left. I thought I was being clever by using the stacking “trick” with
display: grid, but this causes things to look bad when closing the last/right modal. I feel like this should just work, because withdisplay: flexeverything behaves as expected when closing modals.In my example, I have:
modal-containerthat displays the modals from theopenModalarrayWith
display: flexon themodal-container:With
display: gridon themodal-container:2. CodeSandbox reproduction
https://codesandbox.io/p/sandbox/motion-modals-f4qrck
3. Steps to reproduce
display: grid;4. Expected behavior
When using
display: grid, the next modal in the stack (on the left) should slide over smoothly, just like it does when usingdisplay: flex.6. Environment details
Any browsers. Used dependencies are:
"@vueuse/core": "^14.1.0", "motion-v": "^1.8.1", "vue": "^3.5.22",