Skip to content

Commit 7034e8a

Browse files
authored
fix(scrollMode): if-needed should handle negative offsets correctly (#276)
1 parent 18692ee commit 7034e8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compute.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ export default (
263263
}
264264

265265
if (frame === viewport) {
266-
if (targetRect.bottom > viewportHeight) {
266+
if (targetRect.bottom > viewportHeight || targetRect.top < 0) {
267267
return false
268268
}
269-
if (targetRect.left > viewportWidth) {
269+
if (targetRect.left > viewportWidth || targetRect.right < 0) {
270270
return false
271271
}
272272
}

0 commit comments

Comments
 (0)