-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
"Hidden" css class and style "display: none;" are not working with carousel #829
Comments
Please supply with a template and explain what you are trying to do. Thanks. |
Updated my first post. Normally the second slider should be invisible for the user but in the DOM. When you run the code, you will see that the red slider is taking white space and you can swipe to it. It would be great if the bug could be fixed fast. I promise, your next coffee or beer will be payed by me via PayPal! : -) |
QCarousel is not supposed to work like this. Wish you could join the Patreon list, Quasar is in dear needs of funds at the moment: https://www.patreon.com/quasarframework |
When I use "v-if", how I can reference that element? |
Two questions:
|
Well, I'm using WebRTC (peer to peer webcam and audio streams) with Vue.js and the carousel component. In the slide, I have two divs. One with my stream and the second one with the stream of my chat partner. I just want to display the slide, with that streams, only when there is already a connection between me and my chat partner. If there is not a connection between us, the slide has to be invisbile. I need to set the source of the divs with the streams of my WebRTC connection and that is possible when I can reference the div elements, only. |
You can still use "v-if". You will probably have some logic somewhere to determine when's the moment to show that slide or not. When you need to show it, turn the variable binded to v-if to "true" then initialize the rest of the things... this.showSlide = true
// then let Vue update the DOM:
this.$nextTick(() => {
... access the ref, do stuff ...
}) |
Thank you, it works! But why I have to use the "nextTick" function? Why I can not just use "v-if", watch for changes and set the "srcObject" of the video html element after the watched variable changes to true? If I do so, the element can not be found in DOM. Why does it work with "nextTick" function, only? |
Because you need to allow Vue to handle the scope changes (setting |
Software version
Quasar: 0.14.1
OS: Windows 10 x64
Node: /
NPM: 5.3.0
Browsers: Firefox 55.0.2 x32
iOS: /
Android: /
Any other software related to your bug:
/
What did you get as the error?
The div of the carousel should not be visible to the user and not taking space. The error here is, that the div is still taking space (empty and white). I can swipe to the empty white space.
What were you expecting?
The div should be in the DOM, not visible to the user and NOT taking white space.
What steps did you take, to get the error?
Using the "hidden" class for a div in a Carousel component. The same happens with the style attribute "display: none;".
Template / component:
The text was updated successfully, but these errors were encountered: