ngx-drag-scroll
ngx-drag-scroll copied to clipboard
scrollbar-hidden doesn't work when you resize the browser window
I'm using the following:
Angular 7.2.7 ngx-drag-scroll 7.1.4 Chrome 71.0.3578.98
- Set 'scrollbar-hidden' to true with a window size that accommodates all the drag-scroll-items.
- Then resize the window and you will see the scrollbars (both horiz and vert).
If you refresh the browser window so that the component is reinitialized then it works, so the issue is only when the browser window is large and resized to small.
I have a hack to resolve the issue (just working with the public members), calling 'ngAfterViewInit' on window resize will resolve the issue. It's ugly but for the time being will suffice until this is resolved cleanly.
I see that there is already a private function 'onWindowResize', so a better solution would be to handle it cleanly in there.
Were you using Windows Chrome or MacOS Chrome?
You can use bellow style to fix this problem. Enjoy it.
::ng-deep {
.drag-scroll-content {
width: initial !important;
}
}