Skip to content

Commit

Permalink
fix(scroll): adding overflow check for inner scorlls #10949
Browse files Browse the repository at this point in the history
  • Loading branch information
ChronosSF committed Feb 15, 2022
1 parent bb16b6c commit d8faa29
Showing 1 changed file with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,25 @@ export class IgxScrollInertiaDirective implements OnInit, OnDestroy {
while (i < path.length && path[i].localName !== 'igx-display-container') {
const e = path[i++];
if (e.scrollHeight > e.clientHeight) {
if (scrollDeltaY > 0 && e.scrollHeight - Math.abs(Math.round(e.scrollTop)) !== e.clientHeight) {
return true;
}
if (scrollDeltaY < 0 && e.scrollTop !== 0) {
return true;
const overflowY = window.getComputedStyle(e)['overflow-y'];
if (overflowY === 'auto' || overflowY === 'scroll') {
if (scrollDeltaY > 0 && e.scrollHeight - Math.abs(Math.round(e.scrollTop)) !== e.clientHeight) {
return true;
}
if (scrollDeltaY < 0 && e.scrollTop !== 0) {
return true;
}
}
}
if (e.scrollWidth > e.clientWidth) {
if (scrollDeltaX > 0 && e.scrollWidth - Math.abs(Math.round(e.scrollLeft)) !== e.clientWidth) {
return true;
}
if (scrollDeltaX < 0 && e.scrollLeft !== 0) {
return true;
const overflowX = window.getComputedStyle(e)['overflow-x'];
if (overflowX === 'auto' || overflowX === 'scroll') {
if (scrollDeltaX > 0 && e.scrollWidth - Math.abs(Math.round(e.scrollLeft)) !== e.clientWidth) {
return true;
}
if (scrollDeltaX < 0 && e.scrollLeft !== 0) {
return true;
}
}
}
}
Expand Down

0 comments on commit d8faa29

Please sign in to comment.