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

Slide flickers when is entering the viewport #168

Closed
dcosmin2003 opened this issue Feb 8, 2023 · 12 comments · Fixed by #175
Closed

Slide flickers when is entering the viewport #168

dcosmin2003 opened this issue Feb 8, 2023 · 12 comments · Fixed by #175

Comments

@dcosmin2003
Copy link

dcosmin2003 commented Feb 8, 2023

Describe the bug
Elements are flickering when entering the viewport.

To Reproduce
Steps to reproduce the behavior:

  1. Go to CodeSandbox
  2. Scroll down slowly
  3. See how elements entering the viewport are flickering

CodeSandbox link: https://codesandbox.io/s/magical-elbakyan-g9u1e5?file=/src/App.tsx

Expected behavior
A smooth scrolling effect.

Desktop (please complete the following information):

  • OS: macOS
  • Browser [chrome, safari]
  • Version [109.0.5414.119]
@dcosmin2003
Copy link
Author

Hi @morellodev, I'm thinking of migrating from react-reveal to react-awesome-reveal, but this looks like a blocker to me, can you tell me if there's any workaround for this?
Thank you!

@mpeardev
Copy link

I had the same problem, after several days of rain and hot coffee I managed to discover a momentary solution at the time of writing this message. Using version 4.1.0 until they implement an updated solution.

@chambaz
Copy link

chambaz commented Feb 20, 2023

In case helpful for others, I just tried downgrading to 4.1.0 and worked for me also. Thanks @mirkoperamas!

@morellodev
Copy link
Owner

I am investigating 👀

@sniper365
Copy link

sniper365 commented Mar 5, 2023

I am here with same issue on version 4.1.0
When can we get the solution?

chrome_A609tt2u8l.mp4

@Nevemoire
Copy link

I had the same problem, after several days of rain and hot coffee I managed to discover a momentary solution at the time of writing this message. Using version 4.1.0 until they implement an updated solution.

ty a lot, problem solved <3

@RMarmolejo90
Copy link

I get flickering from the Slide animation when it enters the viewport.

@stephenkarpeles
Copy link

Also get flickering on Zoom animation, even on version 4.1.0. Anyone have a magic fix yet?

@stephenkarpeles
Copy link

One solution I found that seems to work is adding style={{ backfaceVisibility: 'hidden' }} to the parent element. Working for Zoom and Slide animation.

@abdullahmehboob20s
Copy link

Version 4.1.0 solved the issue for me

@tom-ricci
Copy link

tom-ricci commented Jun 19, 2023

I'm 99% sure that this bug is caused by the browser occasionally hanging for a frame or two before starting animations, so when the element is mounted into the DOM it shows up as the style defined by its CSS instead of the beginning state of the animation. For now it's fixable by applying the beginning state of the animation as a style to the element. For example, with Tailwind's opacity-0 class you can solve the flicker on <Fade/>:

<Fade className={"opacity-0"}><p>I will gently appear as I enter the viewport</p></Fade>

@Bro3Simon
Copy link
Contributor

Bro3Simon commented Jun 22, 2023

Also get flickering on Zoom animation, even on version 4.1.0. Anyone have a magic fix yet?

@stephenkarpeles, I also had the same issue for Zoom and solved it by downgrading to 4.1.0.

morellodev pushed a commit that referenced this issue Jun 27, 2023
Slide and Zoom flicker when the element is just entering the view and
certain conditions are met. Slide flickers when direction is up.
Zoom flickers when it is styled. This bug is shown in this Code Sandbox,
https://codesandbox.io/s/react-awesome-reveal-bug-vy35p2 .

This is fixed by applying opacity: 0 when the element is not in view.

resolve #168
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

Successfully merging a pull request may close this issue.