benjamincanac / ui3

A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.
https://ui.nuxt.com
MIT License
52 stars 7 forks source link

feat(Modal): open programmatically #78

Closed noook closed 5 months ago

noook commented 6 months ago

๐Ÿ”— Linked issue

Resolves #66

โ“ Type of change

๐Ÿ“š Description

Allows opening modals dynamically

~One feature is missing: we cannot detect the end of the animation to reset the modal state, I think we need something upstream on radix-vue~ย 

๐Ÿ“ Checklist

benjamincanac commented 6 months ago

We're no longer using a component to handle the transition but a CSS animation, I'm afraid it's not really related to radix-vue ๐Ÿค”

noook commented 5 months ago

They use Presence which could kind of allow us to hook into the animation end (if there is one).

Submitted a PR (https://github.com/radix-vue/radix-vue/pull/901) on radix-vue so we can hook on it and reset state properly to avoid flickering while closing

noook commented 5 months ago

@benjamincanac It seems that the transition is now flawless, I didn't even update radix

I don't know what caused the issue last time I tried, but I remember the leaving animation was instant because the component was unmounted too early, it should be ready now

benjamincanac commented 5 months ago

Awesome! I've just renamed the modals plugin to modal and ModalsProvider component to ModalProvider for consistency.

benjamincanac commented 5 months ago

Thanks!!! ๐Ÿ˜Š