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

[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. #270

Open
MohRaouf opened this issue Feb 14, 2024 · 0 comments

Comments

@MohRaouf
Copy link

With the following simple setup of the carousel, in angular 17

@if (dataList$ | async; as items) {
	@if (items.length) {
		<owl-carousel-o [options]="customOptions" (dragging)="isDragging = $event.dragging">
			@for (item of items; track item) {
				<ng-template carouselSlide [id]="item.id"> </ng-template>
			}
		</owl-carousel-o>
	}
}

I get the following warning in the browser console,

branch-viewer.component.html:2 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive.

options I use :

  customOptions: OwlOptions = {
    loop: true,
    center: true,
    autoplay: false,
    autoplayTimeout: 5000,
    autoplayHoverPause: true,
    mouseDrag: true,
    touchDrag: true,
    pullDrag: true,
    navText: ['', ''],
    responsive: {
      0: {
        items: 1,
        margin: 4,
        stagePadding: 4,
      },
      600: {
        items: 1,
        margin: 16,
        stagePadding: 50,
      }
    },
  }

I know it's just a warning for performance recommendation, however it worth to mention and better to fix,

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

1 participant