Skip to content

Commit

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

fix(scroll): adding overflow check for inner scorlls #10949 - 13.0
  • Loading branch information
dkamburov authored Feb 17, 2022
2 parents a4cfa6d + 0c95509 commit 8f5be4e
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 8f5be4e

Please sign in to comment.