Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
imjordanxd committed Dec 14, 2024
1 parent d09e7e5 commit 61afe62
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions dist/InfiniteScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class InfiniteScroll extends React.Component {
const testOptions = {
get passive() {
passive = true;
}
},
};
try {
document.addEventListener('test', null, testOptions);
Expand All @@ -98,12 +98,12 @@ class InfiniteScroll extends React.Component {
if (this.isPassiveSupported()) {
options = {
useCapture: this.props.useCapture,
passive: true
passive: true,
};
}
else {
options = {
passive: false
passive: false,
};
}
return options;
Expand Down Expand Up @@ -185,7 +185,8 @@ class InfiniteScroll extends React.Component {
}
// Here we make sure the element is visible as well as checking the offset
if (offset < Number(this.props.threshold) &&
(el && el.offsetParent !== null)) {
el &&
el.offsetParent !== null) {
this.detachScrollListener();
this.beforeScrollHeight = parentNode.scrollHeight;
this.beforeScrollTop = parentNode.scrollTop;
Expand All @@ -212,7 +213,7 @@ class InfiniteScroll extends React.Component {
render() {
const renderProps = this.filterProps(this.props);
const { children, element: Element, hasMore, initialLoad, isReverse, loader, loadMore, pageStart, ref, threshold, useCapture, useWindow, getScrollParent } = renderProps, props = __rest(renderProps, ["children", "element", "hasMore", "initialLoad", "isReverse", "loader", "loadMore", "pageStart", "ref", "threshold", "useCapture", "useWindow", "getScrollParent"]);
props.ref = node => {
props.ref = (node) => {
this.scrollComponent = node;
if (ref) {
ref(node);
Expand Down Expand Up @@ -245,7 +246,7 @@ InfiniteScroll.propTypes = {
getScrollParent: prop_types_1.default.func,
threshold: prop_types_1.default.number,
useCapture: prop_types_1.default.bool,
useWindow: prop_types_1.default.bool
useWindow: prop_types_1.default.bool,
};
InfiniteScroll.defaultProps = {
element: 'div',
Expand All @@ -258,6 +259,6 @@ InfiniteScroll.defaultProps = {
isReverse: false,
useCapture: false,
loader: null,
getScrollParent: null
getScrollParent: null,
};
exports.default = InfiniteScroll;

0 comments on commit 61afe62

Please sign in to comment.