Closed wangyang2012 closed 7 years ago
Hi, I found the problem by looking the source code: at the line 101 of the file /src/scrollable/scrollable.directive.ts:
let scrollContainerEl = parentElStyle.overflow === 'auto' ?
parentEl : document.body;
When we don't set the overflow value, Chrome adds automatically 'auto' to the list but Firefox lets empty, so that the scrollContainerEl is 'parentEl' in Chrome but 'document.body' in Firefox.
I don't think overflow ==='auto' is useful because it works without, I suggest change this line on:
let scrollContainerEl;
if (horizontal) {
scrollContainerEl = parentEl;
} else {
scrollContainerEl = parentElStyle.overflow === 'auto' ? parentEl : document.body;
}
or
let scrollContainerEl = parentEl;
if (!horizontal) {
scrollContainerEl = parentElStyle.overflow === 'auto' ? parentEl : document.body;
}
Accepting PR., can't make time for this thesedays.
This has been fixed..
Hi, my horizontal scroll works fine on Chrome and Safari browser but it doesn't work on Firefox - it shows automatically the horizontal scrollbar on Firefox but which is hidden on Chrome.
The code is copied from Plunker: https://plnkr.co/edit/wLVudY?p=preview&open=app.component.ts
html file:
css file:
ts component file:
Tks a lot!