slick icon indicating copy to clipboard operation
slick copied to clipboard

Slide blinks at the end of infinite-rotation-transition (🐈)

Open noBlubb opened this issue 9 years ago • 79 comments

The transition from the last slide to the first slide (and inverse) sometimes causes an image within a slide to blink for a moment. I created a jsfiddle with minimal configuration to show this issue: http://jsfiddle.net/f0up44wt/2/ (4-slides version)

Try to slide between Slide 1 and Slide 4 (to the left). At the end of the transition the image will eventually blink. I spent the last 30 minutes sliding cats around and every time i think the bug is gone i see a flickering...check out the fun fact below...

On Chrome 46.0.2490.86 (64-bit) (Mac OS X 10.11.1) it happens:

  • never, when moving "within the normal order" [1, 2, 3, 4], 1->2, 2->1, 2->3, 3->2...
  • sometimes, but only when the previous transition is finished and only when moving between the last and the first slide in infinite scroll mode [1, 2, 3, 4], 4->1 (moving right), 1->4 (moving left)

My guess it's because of the changing transition offset in the root (-slick-) element, but DOM break points didn't really help me to figure it out.

Fun fact increasing the number of cats in the fiddle actually seems to resolve this problem: http://jsfiddle.net/f0up44wt/3/ (10-slides version)

Please +1 if you can reproduce this issue, i'm going crazy :cat2:

noBlubb avatar Nov 13 '15 21:11 noBlubb

+1 I can reproduce it. Someone here possted a fix earlier using CSS. Will try to get it

ahmadalfy avatar Nov 15 '15 18:11 ahmadalfy

#1845 references #1626, but there is no animation for * in my fiddle. Turns out it runs great on Safari so I'll focus on issues with Chrome. I came up with http://stackoverflow.com/questions/3461441/prevent-flicker-on-webkit-transition-of-webkit-transform and will try to adapt this solution.

noBlubb avatar Nov 16 '15 10:11 noBlubb

The given indication was right, see this fiddle: http://jsfiddle.net/f0up44wt/4/ The new backface-visibility-property could cause performance issues so handle with care. https://css-tricks.com/almanac/properties/b/backface-visibility/

#1874 could be related, too.

noBlubb avatar Nov 16 '15 11:11 noBlubb

Small update: The new rule actually fixed the flickering but eventually caused the last slide to disappear from time to time. I made a new fiddle following http://stackoverflow.com/questions/13952480/why-does-applying-webkit-backface-visibility-hidden-fix-issues-with-negativ and this works quite nice for me: http://jsfiddle.net/f0up44wt/5/

So all I needed to fix this was .slick-slide { -webkit-transform: translate3d(0,0,0); }

noBlubb avatar Nov 16 '15 11:11 noBlubb

Thank you for your extended research. Can you try and see if will-change will fix it?

ahmadalfy avatar Nov 16 '15 12:11 ahmadalfy

Sorry, I'm relatively new to Github. I tried to find a branch or label called will-change but no luck on this one? Fixing the declaration in slick.css:43 however should fix this:

.slick-slider .slick-track,
.slick-slider .slick-list
{
    -webkit-transform: translate3d(0, 0, 0);
       -moz-transform: translate3d(0, 0, 0);
        -ms-transform: translate3d(0, 0, 0);
         -o-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
}

noBlubb avatar Nov 16 '15 14:11 noBlubb

@noBlubb the first slide is still flickering on your last fiddle for me http://jsfiddle.net/f0up44wt/5/

what are you changing on line 43? It looks the same as what I have.

I'm still having the issue here: https://github.com/kenwheeler/slick/issues/1961

yangkennyk avatar Dec 10 '15 23:12 yangkennyk

@noBlubb i still experience the issue with your fix.

wiedikerli avatar Dec 17 '15 09:12 wiedikerli

@ninjaonsafari Can you tell more about your env?

noBlubb avatar Dec 26 '15 22:12 noBlubb

@noBlubb

Windows: 8.1 Pro 64bit Chrome: 47.0.2526.106 m Slick: 1.5.8

Live Version

wiedikerli avatar Jan 04 '16 08:01 wiedikerli

The issue persists in a (2 - slide version), any updates on the issue??

kkush avatar Jan 14 '16 09:01 kkush

@noBlubb could you reopen this issue?

wiedikerli avatar Jan 14 '16 10:01 wiedikerli

Done, as this bug still remains.

noBlubb avatar Jan 20 '16 23:01 noBlubb

We'll try to get to the bottom of this, however there should be no cloned-slides in version 2.0, or at least a different way of handling them... so the bug may vanish as a result.

Thanks for all the effort you've put in to the investigation, @noBlubb :smile: :bow:

simeydotme avatar Jan 21 '16 04:01 simeydotme

1+

zlatoroh avatar Jun 09 '16 07:06 zlatoroh

This was happening to me. The reason was because I was referencing slides by ID for styles (background image etc) and the browser wasn't applying them until after the duplicate slide was removed (when animation completes)

Referencing slides by class solved the issue for me.

alexemorris avatar Aug 29 '16 17:08 alexemorris

#2230 definitely fixes this. #1961 and #2243 are also fixed by the #2230

That should definitely be merged to core.

asadkn avatar Sep 07 '16 21:09 asadkn

#2230 does not fix this. I am on Mac OS X Sierra and Chrome and with infinite looping turned on, I get a white flash after the last slide for the first slide entering. I tried to manually add the #2230 fix and it didn't do anything.

davidrhoderick avatar Dec 15 '16 13:12 davidrhoderick

+1

I am also running Sierra and Chrome and encountering the same issue, which as @davidrhoderick mentioned, is not fixed by #2230.

dougkeeling avatar Mar 14 '17 20:03 dougkeeling

+1

Any update on this?

omzy avatar Jul 15 '17 20:07 omzy

+1

Tardis1234 avatar Jul 21 '17 14:07 Tardis1234

I am experiencing this issue as well.

ryanlloydfrench avatar Jul 26 '17 04:07 ryanlloydfrench

+1

denisbouquet avatar Aug 10 '17 10:08 denisbouquet

+1

frontgirl avatar Aug 28 '17 09:08 frontgirl

+1

zckpp avatar Aug 29 '17 15:08 zckpp

+1

ghost avatar Sep 01 '17 08:09 ghost

+1

tondi avatar Sep 13 '17 07:09 tondi

+1

webkitvn avatar Sep 14 '17 14:09 webkitvn

Any updates on this?

RyanCameronMe avatar Sep 17 '17 08:09 RyanCameronMe

+1

ryan-ajmadison avatar Sep 20 '17 15:09 ryan-ajmadison