Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot scroll center for scrollIntoView in iOS #178

Open
imjeen opened this issue Sep 28, 2021 · 4 comments
Open

Cannot scroll center for scrollIntoView in iOS #178

imjeen opened this issue Sep 28, 2021 · 4 comments

Comments

@imjeen
Copy link

imjeen commented Sep 28, 2021

use native API scrollIntoView and make someone element scrolling to center, see Demo in codepen in Safari.

Element.scrollIntoView({
    behavior: 'smooth',
    inline: 'center'
 });

the polyfill cannot make it center in Safari, it looks like only for inline: 'sart'

@davebalmer
Copy link

Nice polyfill! I'd like to see block: 'center' and block: 'nearest' work as well.

@rdowner22
Copy link

I am also experiencing this issue for X axis smoothscroll for all browsers on iOS (Safari, Chrome & Firefox). Currently all is functioning on Android, MacOS, and Windows.

scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' })

Same behavior as the CodePen linked in original post with block: 'center'

Live Example Link for Mobile - https://ryansrealty.idxstaging.com/idx/market-reports/a001/city/springfield-oregon
Recently Sold Section -> Click on a black circle pin on the map.

Video Example of behavior - https://drive.google.com/file/d/1VAm1yu7hXbYEybGrTwVSPGJFkHJlW60P/view?usp=sharing

Expected: Element will be in the center of the viewport of the device.

@CarryOnHxy
Copy link

damn, i hope it will work

@angelbeatsying
Copy link

how to resolve it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants