Coder Social home page Coder Social logo

Comments (6)

jeremenichelli avatar jeremenichelli commented on July 4, 2024

It's not right now, basically because it's not an official standard and has only been implemented in WebKit, but if it makes the cut some day we'll have to :)

from smoothscroll.

yukulele avatar yukulele commented on July 4, 2024

Scroll into view now have a descent support https://caniuse.com/#feat=scrollintoviewifneeded and should not be really hard to implement from current polyfill

from smoothscroll.

iamdustan avatar iamdustan commented on July 4, 2024

@yukulele Element.scrollIntoViewIfNeeded is not on an official standards track nor will it be.

https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17152

scrollIntoView({ behavior: 'smooth', block: 'center' }); is the spec’d way to achieve that effect.

from smoothscroll.

jeremenichelli avatar jeremenichelli commented on July 4, 2024

As @iamdustan said, this is a WebKit only thing, not an official spec.

from smoothscroll.

alejandroiglesias avatar alejandroiglesias commented on July 4, 2024

@iamdustan I guess you mean scrollIntoView({ behavior: 'smooth', block: 'nearest' }); (notice block: 'nearest') is the spec'd way to acheive scrollIntoViewIfNeeded?

from smoothscroll.

jeremyburton avatar jeremyburton commented on July 4, 2024

As Safari and Safari on iOS don't support the options parameter of scrollIntoView(), the only way I have found that I can align an element to the bottom of the scroll container is to use scrollIntoViewIfNeeded. Unfortunately, this proprietary WebKit method isn't supported by this polyfill so I can't have both bottom alignment and smooth scrolling. Unless someone knows better!? Otherwise, I either have to hope this polyfill is updated to support scrollIntoViewIfNeeded or WebKit adds support for the aforementioned options parameter. My app is targeted at mobile Safari so I'm really keen to find a solution :)

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.