Skip to content

Commit

Permalink
Merge pull request #11009 from IgniteUI/sstoychev/inner-scroll-extra-…
Browse files Browse the repository at this point in the history
…master

fix(scroll): adding overflow check for inner scorlls #10949 - master
  • Loading branch information
dkamburov authored Feb 17, 2022
2 parents 53d3de2 + fc35a5d commit 33b44d5
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 33b44d5

Please sign in to comment.