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
scrollTo feature not working anymore, notifications not visible etc #12625
Comments
There is a native Javascript method for this: https://www.w3schools.com/Jsref/met_element_scrollintoview.asp Could you try that? Maybe it is just a bug with Chrome 64? |
I think this has maybe to do that the library is using an old method to scroll that seems to have been removed. But as scrolltoView() is supported by every browser, that seems to be a simple solution: |
If we use |
Just tested it with |
There is no really easy way to detect if smooth scrolling is supported, but following code does it: https://codepen.io/Fyrd/pen/RrqLBE But what to use if not supported? Use the old method and hope? |
Found the issue w/ jquery.scrollTo. Here: https://github.com/matomo-org/matomo/blob/3.x-dev/libs/bower_components/jquery.scrollTo/jquery.scrollTo.js#L43 jquery.scrollTo selects the body element as the element to change the Unfortunately, I can't find a way to monkey patch this. But there exists a polyfill for smooth scrolling: http://iamdustan.com/smoothscroll/. Would need to test across browsers. |
I noticed when a notification appears, example from an API or any other request error using
piwikApi
, then the notification is never scrolled to. At first I thought it was because it doesn't wait for angular to render a notification see b801546This was not the case so I thought
$.scrollTo
is getting an element instead of a position but that's all correct as well after checking out the docs for it. So I tried various things directly like$.scrollTo(100)
or$.scrollTo(document.getElementById('...'), 250)
etc. and nothing worked in latest Chrome 64 on Mac.Seeing that the library is very old I wouldn't be surprised if it is broken. I didn't test any other browsers but this is pretty annoying since you press "create" or "update" somewhere, and nothing happens. Only later when you figure out to scroll around you may notice the error notification if it hasn't disappeared by now.
The text was updated successfully, but these errors were encountered: