Skip to content

Commit 3028931

Browse files
committed
fix: set inView if intersectionRatio is 1
This closes #387
1 parent 810ae06 commit 3028931

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/observers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function createObserver(options: IntersectionObserverInit) {
5757
const inView =
5858
entry.isIntersecting &&
5959
observer.thresholds.some(
60-
(threshold) => entry.intersectionRatio > threshold,
60+
(threshold) => entry.intersectionRatio >= threshold,
6161
);
6262

6363
// @ts-ignore support IntersectionObserver v2

src/stories/Status/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function Status({ inView }: Props) {
1414
<div
1515
css={{
1616
position: 'fixed',
17+
zIndex: 1,
1718
top: 0,
1819
right: 0,
1920
width: 32,

0 commit comments

Comments
 (0)