-
Notifications
You must be signed in to change notification settings - Fork 81
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
Modal component doesn't work twice #497
Comments
Any error in logs? |
Hm, I can reproduce that with the modal example code in https://nextcloud-vue-components.netlify.com/#/Components?id=modal Seems this is cause by using v-show to trigger the modal, switching to v-if fixes it. @skjnldsv Any idea why this is an issue? |
I would say because we do not detect the modal hide/show other than on mounted? |
It seems that I can't use $refs anymore when using v-if
I'm suddenly getting |
Well you named your ref "modalCanvas" not "canvas" :p |
no, that's not the issue, I've:
It seems to be caused by the fact that v-if doesn't create the DOM element unless needed while v-show always creates it and just toggles the display CSS property. |
Ah yes indeed, you cannot use an item inside if v-if is false. |
and $refs is not reactive :-( |
@StCyr I think this needs to be fixed from the modal component, not yours :) |
I've studied more what's happening when opening/closing a modal: 1- When opening a page with a modal component, the modal component's element with class This explains why the modal component's content is show only once. Now, I have no idea how to fix this. |
I'll try to take a look this week if I have time :) |
yeah, using v-if solves the issue. Hope to see you there :-) |
that component. See nextcloud-libraries/nextcloud-vue#497 Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
that component. See nextcloud-libraries/nextcloud-vue#497 Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
Hi,
I'm using the Modal component to display attached images in the "social" application.
For some reasons, images aren't displayed when the user tries to display them a second time: the Modal component shows a black screen with only the "x" icon in the top-right corner.
Do i use the component wrong, or is it some kind of limitation?
Thanks for the help,
Cyrille
Steps to reproduce the issue
Additional info
Here's where I use the component:
https://github.com/nextcloud/social/blob/master/src/components/PostAttachment.vue
The text was updated successfully, but these errors were encountered: