-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Max call stack exceeded (infinite loop) on mobile #3447
Comments
Any update on this? |
I am also getting this issue on android. It is breaking on my development site, but not when I copied and pasted it into jsfiddle. http://jsfiddle.net/CraigNewland/fmo50w7n/3262/ I have tried with slick 1.6.0 and 1.9.0 and I tried jQuery 2.1.1 and jQuery 2.2.4 I am running on an Android galaxy using Chrome version 66.0.3359.158 Operating System - Android 8.0.0; SM-G950U Build/R16NW |
I was async loading my css. If I turn that off, it seems to work. Here is how I was doing it. <style>body{position: relative;}body:after{content:'';display:block;position:absolute;background:#fff;top: 0px; left: 0px; width:100%;height:100%;z-index:999999;}body.css-loaded:after{display: none;}</style> <script>function cssLoaded(e){$("body").addClass("css-loaded")}</script> |
This seems to occur when the slideshow directly affects the page width - so when it's the widest thing on the page. |
Interesting...maybe a resize loop is happening. The arrows on the slider made it the widest thing on my page and removing the arrows (to make it not the widest) indeed fixed it. I'm sure moving the arrows inside the container will also work |
I'm not sure how active this project is (many open pull requests and issues). For anyone coming across this particular problem, I solved this by adding a width parameter to the checkResponsive function. First pass, in response to a change in window size kicks off the process, but instead of recalculating the width upon second initialization it uses the width that was passed from the first call. This breaks the infinite loop. Attached is a patch of the changes that worked for me, no guarantees. |
@willbroderick you are a god amongst mortals |
Just ran into this issue myself... is there a PR that fixes this? if so can it be merged and released? |
@willbroderick This fix works perfectly : ) |
This solution by @willbroderick worked for me |
This worked for me for v 1.8.1 |
@willbroderick the div with className 'slick-list' have the overflow:hidden property but it is still show the no passive event warring in my console. Config
Usage
Tech Stack : React Can you please tell me what should i do the make this warring resolvable? I will be very thankful to you. |
This worked for me. |
https://jsbin.com/nedubarado/edit?html
Steps to reproduce the problem
What is the expected behaviour?
The page loads with the carousel
What is observed behaviour?
The page enters an infinite loop before reaching max call stack exceeded (and crashing outright on low-powered devices)
More Details
@paulirish and I dug into this, it looks like the loop is in the init/refresh/checkResponsive loop
slick/slick/slick.js
Lines 595 to 608 in a2aa3fe
The issue is that
.init
(which calls.setPosition
) mutates thewindow.innerWidth
which causesrespondToWidth
to change betweencheckResponsive
calls. As a result,checkResponsive
flips back and forth betweenactiveBreakpoint = null
andtargetBreakpoint = null
forever.Originally reported in GoogleChrome/lighthouse#5208
The text was updated successfully, but these errors were encountered: