Closed fredlcore closed 3 years ago
Ok, I found the solution: In order to access smoothscroll from an iFrame on the parent window, smoothscroll has to be loaded there as well. Once this is done, it works like charm. Thanks again for your great work!
Hi,
first of all, thanks for this great library! I have the following situation where smoothscroll isn't working as expected: A script of mine runs in an iFrame on a Wordpress page. The script detects whether it is called on its own or whether it's running in an iFrame and uses
scrollIntoView
in the former case andwindow.parent.scrollTo
in the latter. The former works nicely on Safari, but the latter does not. It just jumps directly to the given position as it would without smoothscroll. I have tried settingwindow.__forceSmoothScrollPolyfill__ = true;
before including smoothscroll and run it on Firefox where the problem does not arise (the parent window is scrolled smoothly which it also does natively without smoothscroll). So I assume this is not because window.parent.scrollTo is not supported by smoothscroll, but some kind of Safari related issue? You can see this behavior in my project https://evangelisch-im-wendland.de/gottesdienste - just click on the "Suchen" button and it should scroll to the result section (instead of jumping there).If there's anything I can do to provide more information for debuggin, please let me know - thanks!