robinparisi / tingle

⚡ 2kB vanilla modal plugin, no dependencies and easy-to-use
https://tingle.robinparisi.com
MIT License
1.55k stars 185 forks source link

Modal destroys CLS (Cumulative Layout Shift) based on where the user is on page when opened. #150

Open jmplummer opened 3 years ago

jmplummer commented 3 years ago

Has anyone else noticed that tingle causes drastic changes in CLS if scrolled further down the page and it puts top: -8000px for example on the <body> tag?

Any idea how to fix this using this plugin?

robinparisi commented 3 years ago

Hi,

I am not sure that CLS applies here since this metric measures the stability of the layout, so the opposite of the principle of a modal.

Maybe I'm missing something, could you share more informations about your measure and use case?