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

Reflow violation and jump scroll #24

Open
annelyse opened this issue Aug 22, 2022 · 1 comment
Open

Reflow violation and jump scroll #24

annelyse opened this issue Aug 22, 2022 · 1 comment

Comments

@annelyse
Copy link

Hello,

I'm using MatchHeight and I notice on mobile ( tested on chrome, android) , I have an issue.
Warning in concole : "[Violation] Forced reflow while executing JavaScript "
a reflow is started every time I'm scrolling up and down in the page, and when the address bar is hide/display.
And there is a jump in the scroll every time it happen.
Do you have a solution for this ?
Thanks a lot

@annelyse annelyse changed the title Reflow Reflow violation and jump scroll Aug 22, 2022
@annelyse
Copy link
Author

The problem seems to come to the resize event.
Because on mobile, when address bar is hided or displayed, the resize event is call

I found a solution to avoid this :

let document_width = window.innerWidth; let document_height = window.height; window.addEventListener("resize", function () { // test pour éviter que le resize soit lancé au scroll sur mobile, lorsque l'adresse bar est cachée ou affichée if (document_width != window.innerWidth || document_height != window.height) { document_width = window.innerWidth; document_height = window.height; console.log('resize'); } });

The code must be added directly in the library, can you modify it ?

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