We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c357c2f + 970b83e commit a1f94b0Copy full SHA for a1f94b0
src/Carousel.vue
@@ -662,12 +662,13 @@ export default {
662
*/
663
const getCarouselWidth = () => {
664
if (vueConciseCarousel.value) {
665
- const carouselInnerElements = vueConciseCarousel.value.getElementsByClassName(
+ const elements = vueConciseCarousel.value.getElementsByClassName(
666
'VueCarousel-inner'
667
);
668
- for (let i = 0; i < carouselInnerElements.length; i++) {
669
- if (carouselInnerElements[i].clientWidth > 0) {
670
- carouselWidth.value = carouselInnerElements[i].clientWidth || 0;
+ for (let i = 0; i < elements.length; i++) {
+ const width = elements[i].getBoundingClientRect().width || 0;
+ if (width > 0) {
671
+ carouselWidth.value = width;
672
}
673
674
0 commit comments