Honestly, the native js scroll to element is hit or miss. I’ve found that adding a tiny delay with `setTimeout` can help with the clunkiness.
```js
setTimeout(() => {
document.getElementById('yourElement').scrollIntoView({ behavior: 'smooth' });
}, 100);
```
Weird, but it works. For easing, you’d need to manually animate the scroll position using `window.scrollY` and a lerp function. Mozilla’s docs have a solid example.
```js
setTimeout(() => {
document.getElementById('yourElement').scrollIntoView({ behavior: 'smooth' });
}, 100);
```
Weird, but it works. For easing, you’d need to manually animate the scroll position using `window.scrollY` and a lerp function. Mozilla’s docs have a solid example.
