Coder Social home page Coder Social logo

Comments (10)

sk1p avatar sk1p commented on July 4, 2024 1

I think I found the issue. Can you check if the flag "Experimental Web Platform features" is enabled in chrome://flags? In my tests, enabling this flag leads to "scrollBehavior" in document.documentElement.style === true and the erratic behavior.

from smoothscroll.

sk1p avatar sk1p commented on July 4, 2024 1

For reference, the bug and code review for the implementation of smooth scrolling with scrollIntoView in Chrome

from smoothscroll.

tstock55 avatar tstock55 commented on July 4, 2024

Having the same issue as Matt. As a workaround I just renamed the function so the native version was not called

from smoothscroll.

jeremenichelli avatar jeremenichelli commented on July 4, 2024

On Chrome 55 and it looks like it's working OK. At least on the polyfill's site. If you have an example where scrollIntoView fails please share it.

Is it Chrome stable or canary?

from smoothscroll.

dalemartyn avatar dalemartyn commented on July 4, 2024

yeah its not working for me in chrome 57. 'scrollBehavior' in document.documentElement.style is true. wondering if there's a different way to feature detect?

from smoothscroll.

dalemartyn avatar dalemartyn commented on July 4, 2024

just to clarify, i think chrome now supports window.scroll({ behavior: 'smooth' }) natively, but doesn't support element.scrollIntoView({ behavior: 'smooth' })

from smoothscroll.

benvoynick avatar benvoynick commented on July 4, 2024

Still working for me in Chrome 57.

I note that document.documentElement.style.scrollBehavior is undefined on my copy of Chrome.

from smoothscroll.

sk1p avatar sk1p commented on July 4, 2024

Interesting. Maybe a platform issue?
On Linux using Chrome Version 58.0.3029.81 (64-bit):

  • Native smooth scrolling using window.scroll, window.scrollBy works
  • scrollIntoView ignores the smooth behavior
  • "scrollBehavior" in document.documentElement.style is true

On Android, Chrome 57:

  • "scrollBehavior" in document.documentElement.style is false
  • because of that, the polyfill is used successfully...

What platform are y'all on?

from smoothscroll.

dalemartyn avatar dalemartyn commented on July 4, 2024

yeah, you're right. i had the flag enabled. my bad.

from smoothscroll.

jeremenichelli avatar jeremenichelli commented on July 4, 2024

Closing the issue since in Chrome stable with no experimental flag being enabled the style check the polyfills does returns false.

from smoothscroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.