Skip to content
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

carousel is not rendering properly in angular 16 #272

Open
ritikRidingad opened this issue Mar 17, 2024 · 3 comments
Open

carousel is not rendering properly in angular 16 #272

ritikRidingad opened this issue Mar 17, 2024 · 3 comments

Comments

@ritikRidingad
Copy link

ritikRidingad commented Mar 17, 2024

summary

carousel is not rendering properly in angular 16.2 and it is rendering first time and after refreshing the page it breaks itself in production mode. it is working properly fine in localhost:4200 .

package version

"ngx-owl-carousel-o": "^16.0.0",

my code configuration

	customOptions: OwlOptions = {
		loop: true,
		mouseDrag: true,
		touchDrag: true,
		pullDrag: true,
		dots: false,
		autoplay: true,
		navSpeed: 50,
		navText: ['', ''],
		responsive: {
			0: {
				items: 1
			},
			400: {
				items: 1
			},
			740: {
				items: 1
			},
			940: {
				items: 1
			}
		},
		nav: false,
		autoplayTimeout: 1500
	}
<owl-carousel-o [options]="customOptions">
				<ng-container *ngFor="let image of imageData">
					<ng-template carouselSlide>
						<img [src]="image?.img" class="object-contain w-full h-[450px] max-sm:p-1" 
                                                 [alt]="image?.img" />
					</ng-template>  
				</ng-container>
 </owl-carousel-o>

images

Image 1

Screenshot (221)

Image 2

Screenshot (222)

please help me how can i fix it ?

@ritikRidingad ritikRidingad changed the title carousel break carousel is not rendering properly Mar 17, 2024
@ritikRidingad ritikRidingad changed the title carousel is not rendering properly carousel is not rendering properly in angular 16 Mar 17, 2024
@ritikRidingad
Copy link
Author

@shiv-source

@BartolomeoItaliano
Copy link

I experience similar issue.

@BartolomeoItaliano
Copy link

This is the only way I found to solve the issue.
I shared it on stack overflow:

https://stackoverflow.com/questions/58050522/refresh-owl-carousel-in-angular/78538867#78538867

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants