Skip to content

Commit

Permalink
fix: 修复relativeToViewport不生效问题
Browse files Browse the repository at this point in the history
  • Loading branch information
heweishui committed Jun 19, 2024
1 parent 3098630 commit ae0f778
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class TaroHarmonyHybridIntersectionObserver implements Taro.IntersectionO
// 使用时间戳而不是entry.time,跟微信小程序一致
time: Date.now(),
id: entry.target.id,
// eslint-disable-next-line dot-notation
dataset: entry.target['dataset']
}
// web端会默认首次触发
Expand Down Expand Up @@ -125,7 +126,7 @@ export class TaroHarmonyHybridIntersectionObserver implements Taro.IntersectionO
}

public relativeToViewport (margins?: Taro.IntersectionObserver.RelativeToViewportMargins | undefined): Taro.IntersectionObserver {
return this.relativeTo('.taro_page', margins)
return this.relativeTo('.taro_router', margins)
}

private _getCallbackByElement (element: Element) {
Expand Down

0 comments on commit ae0f778

Please sign in to comment.