Skip to content

Commit

Permalink
fix: 跳转进入到可下拉刷新的页面无法下拉刷新 (#11747)
Browse files Browse the repository at this point in the history
Co-authored-by: Zakary <zakarycode@gmail.com>
  • Loading branch information
tangbzai and ZakaryCode committed May 9, 2022
1 parent 3e8c8eb commit fdedea2
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export class PullToRefresh implements ComponentInterface {
private _isMounted = false;

private get scrollContainer () {
return document.querySelector('.taro_page_stationed') ||
return this.el.parentElement ||
document.querySelector('.taro_page_stationed') ||
document.querySelector('.taro_page') ||
document.querySelector('.taro_router') ||
document.querySelector('.taro-tabbar__panel') ||
Expand Down Expand Up @@ -126,11 +127,11 @@ export class PullToRefresh implements ComponentInterface {

init = () => {
const ele = this.scrollContainer
const child = this.el.childNodes[this.el.childNodes.length - 1].childNodes[0]
this.el.appendChild = child.appendChild.bind(child)
this.el.insertBefore = child.insertBefore.bind(child)
this.el.replaceChild = child.replaceChild.bind(child)
this.el.removeChild = child.removeChild.bind(child)
const child = this.el.querySelector('rmc-pull-to-refresh-content')
this.el.appendChild = child?.appendChild.bind(child)
this.el.insertBefore = child?.insertBefore.bind(child)
this.el.replaceChild = child?.replaceChild.bind(child)
this.el.removeChild = child?.removeChild.bind(child)
this._to = {
touchstart: this.onTouchStart.bind(this, ele),
touchmove: this.onTouchMove.bind(this, ele),
Expand Down

0 comments on commit fdedea2

Please sign in to comment.