Comments (14)
This is one of the edge cases where the scripts has a hard time trying to find if the element you want to scroll into view is inside a scrollable element or is the body itself.
By looking at the code the #nesting-parent has a position: absolute
and the nesting childs overflow: scroll
which in Chrome might cause a difference between the height and the scrollHeight property of the parent, which makes the script think that #nesting-parent is a scrollable element.
If you remove the position: absolute
from #nesting-parent the script will work well. Since this is not a real case scenario it's hard to find where the script is failing exactly.
We are aware that this is probably the weakest part of the polyfill, but it's hard to infere how a fix could solve this situation since the example is a little messy.
Thanks for reporting.
from smoothscroll.
Yes, if I remove position: absolute
, Chrome works fine.
But it is required in my real use case(sorry, I cannot publish it for now). So, I'm using this library with patch.
I realize it's hard to dig deeper and fix it so I'm not intended to hurry you. I raised this issue just for your information. How about to write about this issue in README till it's fixed?
from smoothscroll.
Sounds good, but I feel that more insight is needed to be more accurate on what is exactly what the script is missing.
For now, let's leave this issue open since it's the purpose of the issues tab indeed. But please, let me know when your project is live to debug more deeply and be able to determinate the problem with better precision.
from smoothscroll.
For now, let's leave this issue open since it's the purpose of the issues tab indeed.
Okay.
But please, let me know when your project is live to debug more deeply and be able to determinate the problem with better precision.
Of course okay although actually I'm patching this lib in my project. And more notice on this issue board will be required at that time because the site is written in Japanese. Its HTML structure and CSS might help you to research.
I respect your effort to solve problems. Thank you very much!
from smoothscroll.
No problem @KitaitiMakoto, keep us in the loop so we can investigate further.
from smoothscroll.
Hi,
Our site was published:
https://lp.koyamachuya.com/uchurinchu/
It uses smoothscroll lib with patch. The patch is hosted on my nonesting
branch:
https://github.com/KitaitiMakoto/smoothscroll/tree/nonesting
Here is site description:
At first, when assets are loaded, a button to continue appears.
After click the button(it uses your smoothscroll but patch is not required here),
from smoothscroll.
(Sorry, I pushed comment button by mistake. will continue description...)
After you click the button(it uses your smoothscroll but patch is not required here), some contents and four pink dots on the left appear.
This smoothscroll lib is used for the dots with patch. If the patch is not applied, they don't work well on Chrome.
Is this description enough? Because I know my English is not good, please feel free to ask questions to clear things. Thanks!
from smoothscroll.
Hi @KitaitiMakoto, the explanation is more than clear.
Sorry to ask for one more thing, but can you summit a pull request with the exact change you needed to do to get it working?
from smoothscroll.
@jeremenichelli
OK, done here: #40
from smoothscroll.
Excellent, thanks @KitaitiMakoto. As soon as I have time I'll try to replicate the bug and see If I can come with a solution to it.
from smoothscroll.
Thank you!
from smoothscroll.
This issue should be solved now that #41 was merged. Closing.
from smoothscroll.
I confirmed this fixed, great! Thank you, @jeremenichelli !
from smoothscroll.
Thanks you for reporting and helping find the issue @KitaitiMakoto 🎉
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.