In my panel I have a div element with the css property:
overflow-x: hidden;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
This element has some content that needs to be scrolled. On a desktop, it’s work OK, but on touch devices it’s doesn’t work. I can not understand why scrolling does not work on mobile devices? I suspect that this is somewhere in the properties of the grafana css but I can’t find it.
By the way, Grafana 4.6 works perfectly on all devices.
Very strange. But it does not work for me for my “galaxy note s8”. Even if I select a device in the developer tools, it still does not work. Here is an exampled code that I run: git hub
And here is showing video the result of the work: on Grafana 4 and on Grafana 5
It should be noted that when I switch the mode I update the page.
Hmm, not seeing the same thing you are seeing. Cannot reproduce this in the Chrome dev tools. It is not working on my iPhone but it is different from your repro - the scroll bar is not visible at all.
If the height of the panel is greater than 300px then scrolling will not work on mobile. Scrolling does work if you either increase the max-height property or make the panel smaller or just remove the max-height property.
Would just removing the max-height property work in your case? The panel will scroll automatically if the content overflows the panel.
There is a potential bug though if you need a scrolling div within a panel and the div’s max-height is less than the panel height. This div scrolls on desktop but not on mobile:
The parameter max-height (or “heigth”) is needed to enable overflows and scrolling. Without it, I can not make the div scrollable. From documentation:
In order for overflow to have an effect, the block-level container must have either a set height (height or max-height) or white-space set to nowrap. (docs)
Yes, but do you need to make the div scrollable? The panel has a height and the overflow property set so it will add a scroll bar if the content overflows.
I’m now completely confused
Actually, it only works in a text plugin. My code is still dosen’t work. I looked at the source code of the text plugin and did not find anything that could help me.
I tried to use “ng-bind-html” but it didn’t help me.
Also I noticed such a feature that when I scroll in a text plugin, a class ps--scrolling-y is added to the parent tag:
And it is definitely due to the new perfect-scrollbar component. I think I might disable it for mobile/small screens so that they just use native scrolling - that will take a day or two to figure out.