Comments (6)
Just tested this in the demopage, last version of Safari and it works perfectly fine.
After applying scrollIntoView
the y scrolled position is 0
. Check if you have some margin on the #top
element or padding in the body.
If you can please specify version of Safari and provide a gist with the example so I can reproduce exactly your issue. Thanks.
from smoothscroll.
I have * { padding: 0.025px }
to un-collapse all margins. Darn. Wonder what can be done. Would rounding this library's math affect any of its known test cases?
from smoothscroll.
Well, the thing is that there's an easing function controlling the scrolling steps so rounding numbers might cause an undesired effect. It seems to me that this is project specific issue and not a problem with the polyfill.
from smoothscroll.
Ok, thanks.
from smoothscroll.
No problem. As a final note, If you need to go to the initial position I would try to use scroll
or scrollTo
with 0
value for top
though I don't know well the needs around your project.
from smoothscroll.
I'm using a simple pushState
router for smooth-scrolling page fragments/hashes. I just did html,body { padding-top:0 }
which was fine for my site design.
from smoothscroll.
Related Issues (20)
- smoothscroll no working when added @media query to document HOT 1
- Newest version isn't published to NPM because of that Cloudflair CDN can't get newest version HOT 2
- Body can't be used as scroll-container HOT 4
- Smoothscroll Flickering Page Elements and too fast on Safari 13.0.5 HOT 2
- Make scrollIntoView work for Safari and SVGElement HOT 4
- smooth scroll is not working in chrome version>=81 HOT 2
- [Feature Request] Padding option HOT 2
- Doesn't work with Safari CSS Scroll Snap HOT 3
- window.scrollTo with behavior: 'smooth' doesn't scroll to the top of the page with safari
- Check for existence of window to support SSR HOT 3
- null as the first argument causing a TypeError
- smoothscroll from <script> tag not working HOT 1
- Accessibility: respect prefers-reduced-motion
- Not working with window.parent? HOT 1
- Support for `scrollTop` & `scrollLeft` for Elements
- scrollIntoView with arguments is not working HOT 3
- Polyfill not working on Safari 15 (iOS & macOS) HOT 24
- Cannot scroll center for scrollIntoView in iOS HOT 4
- Support scrollBehavior after connecting the polyfill
- undefined is not an object (evaluating 'e.clientHeight')
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smoothscroll.