ngx-slimscroll
ngx-slimscroll copied to clipboard
Generated div height not resizable
I use the slimscroll in a dive that takes up different height because the element above can be collapsed. On the generated div with class "slimscroll-wrapper" I see it's got a fixed height. In Inspector mode i change the height to 100% and this fixed the problem by taking up the available space.
How can I take the div with class "slimscroll-wrapper" take the available height when resized?
hi @l-ollie. we need to find a way to detect change on height, but this is harder that it sounds. the resize event only exists on window and some contributor already tried with MutationObserver which doesn't work as expected. if you have any suggestions they are welcome.
Nice! You changed to 100% height. I think this is a nice fix if the container resize a bit. After some tests I found out that the scroll bar doesn't resize. If the size changes a bit, it's absolutely not a problem. But if it's a huge change in size, the scroll bar gives a little confusion because it doesn't represents the scrolling position. After a little bit of fiddling around, I think, if you change the fixed height of the slimscroll-bar aswell into a % this would solve a huge part of the problem.
Maybe its an idea to calculate the height of the slimscroll-bar in % instead of fixed px so its scales better?
Yesterday I updated to Angular 4 and I noticed that the height of the generated div is set to a fixed height again. I would love for it be relative again!
Can confirm, using angular 4 and angular flex-layout doesn't help my div resize after loading data.
I made it work in my project with this commit Maybe, it'll be helpfull for somebody.
@DDroll can you make a PR please?
@jkuri i'm not sure, that it'll work in enveronment, differing from mine. I think you need just this part
@HostListener('window:resize', ['$event'])
onResize() {
this.getBarHeight()
}
no problem, please make a PR, I checked your commit and cannot do any harm only good 👍