Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ const checkOverflowVisible = function checkOverflowVisible(component, parent) {
: [component.props.offset, component.props.offset]; // Be compatible with previous API

return (
offsetTop - offsets[0] <= intersectionHeight &&
offsetTop - offsets[1] <= intersectionHeight &&
offsetTop + height + offsets[1] >= 0 &&
offsetLeft - offsets[0] <= intersectionWidth &&
offsetLeft + width + offsets[1] >= 0
offsetLeft + width + offsets[0] >= 0
);
};

Expand Down Expand Up @@ -135,7 +135,7 @@ const checkNormalVisible = function checkNormalVisible(component) {
: [component.props.offset, component.props.offset]; // Be compatible with previous API

return (
top - offsets[0] <= windowInnerHeight &&
top - offsets[1] <= windowInnerHeight &&
top + elementHeight + offsets[1] >= 0
);
};
Expand Down