Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mui.class.scroll.js 解决某些情况下wrapper发生原生滚动导致组件无法向上回滚的问题 #374

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
9 changes: 7 additions & 2 deletions js/mui.class.scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,8 @@
},
resetPosition: function(time) {
var x = this.x,
y = this.y;
y = this.y,
dy = this.wrapper.scrollTop;

time = time || 0;
if (!this.hasHorizontalScroll || this.x > 0) {
Expand All @@ -715,6 +716,10 @@
y = this.maxScrollY;
}

if(dy > 0){
this.wrapper.scrollTop = 0;
y -= dy;
}
if (x == this.x && y == this.y) {
return false;
}
Expand Down Expand Up @@ -935,4 +940,4 @@
});
return scrollApis.length === 1 ? scrollApis[0] : scrollApis;
};
})(mui, window, document);
})(mui, window, document);