Skip to content

What is smooth scrolling on forms and what effects can this behavior have on users? #529

Answered by 1Copenut
GnatalieH asked this question in Q&A
Discussion options

You must be logged in to vote

Sure thing @GnatalieH ! The smooth scrolling effect (IE, watching grass and trees go by while looking out the car window) could cause some users to experience dizziness, nausea, or other side effects. Most operating systems now offer a prefers-reduced-motion option in the system preferences or settings. I'd like to consider checking for this setting in our scroll to top UI helper.

I believe we could do this with a one-line JavaScript check:

const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");

If the prefers-reduced-motion was evaluated to true, we could change the duration: 0 and smooth: false to override the smooth scrolling effect for a "jump cut" instant move.

More…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by GnatalieH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants