-
Notifications
You must be signed in to change notification settings - Fork 544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opening/closing modals programmatically #1557
Comments
|
In my scenario I use popup to show data coming from parent component. In this case, when I click outside, the old data is still shown even though I send another data because the popup is not onmounted. You can emit the outside click event and get both the transition animation and unmount the popup. But I think it shouldn't be this way. If the popup does not appear on the screen, it must be unmounted. Is there any reason to use keep alive here? |
You can use
for fade-out transition while closing modal programmatically |
Hi @peterhijma, Have you solved your issue with the above responses? |
Just to clarify, the current behavior of the Having said that, this is either a bug on the side of
Clicking outside of the modal doesn't trigger the close event on the composable, so this might be the issue. The composable doesn't know that you clicked outside of the modal. As a workaround for now, you can try to use the @benjamincanac I think this can be marked as a feature request -- Add events to |
My problems seem to have been solved, thanks a lot all involved 🥳 |
Description
I've got two questions regarding opening/closing modals programmatically.
1
If I open a modal with a form using
const modal = useModal(); modal.open(SomeModal)
I can fill in some data in the form, then close the modal by clicking outside of the modal. Then if I open the modal again, the form is still filled with data. Should this be the case? What would be a good "workaround"?2
If I close a modal using
const modal = useModal(); modal.close()
, there is no fade-out transition. It disappears immediately. Is this on purpose or is it a bug? Using this method, the first described problem is not occurring. Why is there a difference?The text was updated successfully, but these errors were encountered: