G
G
GGatsby2020-05-19 12:04:51
safari
GGatsby, 2020-05-19 12:04:51

How to make smooth scrolling in safari?

I'm doing a project on nextJS.
It is necessary to implement a smooth scroll by id to the element. For this I use element.scrollIntoView().

Smooth scrolling everywhere, except for safari. How to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2020-05-19
@hzzzzl

will have to polyfill
https://github.com/iamdustan/smoothscroll

import smoothscroll from 'smoothscroll-polyfill';
// kick off the polyfill!
smoothscroll.polyfill();

it's probably enough to add these lines to _app.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question