gokarna-theme / gokarna-hugo

A minimal opinionated theme for Hugo
https://gokarna-hugo.netlify.app
GNU General Public License v3.0
357 stars 139 forks source link

Fix back to top button not working #225

Closed tyage closed 2 months ago

tyage commented 3 months ago

Since scroll-behavior: smooth is applied in #213 , back to top button didn't work in Google Chrome.

This is a known issue that Chrome calls requestAnimationFrame in every tick.

https://stackoverflow.com/questions/73052119/scroll-behavior-smooth-doesnt-work-on-html-in-chrome

I think there is no need call smoothScrollToTop function and just calling window.scrollTo is fine, because we already have scroll-behavior: smooth.

netlify[bot] commented 3 months ago

Deploy Preview for gokarna-hugo ready!

Name Link
Latest commit 22a339edc7d65d621d399eb27b639487b5e916da
Latest deploy log https://app.netlify.com/sites/gokarna-hugo/deploys/668fe96bed333a0007ccb25b
Deploy Preview https://deploy-preview-225--gokarna-hugo.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

yashmehrotra commented 3 months ago

LGTM

@526avijitgupta I've tested on Firefox and Chromium, can you test it as well and merge this ?

526avijitgupta commented 2 months ago

Works! Thanks for the fix @tyage

tyage commented 2 months ago

thanks!