Merge branch 'dev' into next

This commit is contained in:
chenjiahan
2020-08-22 18:11:26 +08:00
11 changed files with 41 additions and 9 deletions
+8 -1
View File
@@ -272,8 +272,15 @@ export default createComponent({
let height = 0;
let currentMonth;
// add offset to avoid rem accuracy issues
// see: https://github.com/youzan/vant/issues/6929
const viewportOffset = 50;
const viewportTop = top - viewportOffset;
const viewportBottom = bottom + viewportOffset;
for (let i = 0; i < months.length; i++) {
const visible = height <= bottom && height + heights[i] >= top;
const visible =
height <= viewportBottom && height + heights[i] >= viewportTop;
if (visible && !currentMonth) {
currentMonth = monthRefs[i];