Skip to content

Commit

Permalink
fix: calendar 日历组件上下滑动回弹 (#1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyatong authored Jun 6, 2023
1 parent 9796f7f commit 9215097
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
10 changes: 1 addition & 9 deletions src/packages/calendaritem/calendaritem.taro.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useState, useEffect, useRef } from 'react'
import classNames from 'classnames'
import { ScrollView } from '@tarojs/components'
import { nextTick } from '@tarojs/taro'
import bem from '@/utils/bem'
import Utils from '@/utils/date'
import requestAniFrame from '@/utils/raf'
import { useConfig } from '@/packages/configprovider/configprovider.taro'
import { nextTick } from '@tarojs/taro'

type CalendarRef = {
scrollToDate: (date: string) => void
Expand Down Expand Up @@ -536,14 +536,6 @@ export const CalendarItem = React.forwardRef<
}
} else {
const viewPosition = Math.round(currentScrollTop + viewHeight)
if (
viewPosition <
state.monthsData[current].cssScrollHeight +
state.monthsData[current].cssHeight &&
currentScrollTop > state.monthsData[current - 1].cssScrollHeight
) {
current -= 1
}
if (
current + 1 <= state.monthsNum &&
viewPosition >=
Expand Down
8 changes: 0 additions & 8 deletions src/packages/calendaritem/calendaritem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -535,14 +535,6 @@ export const CalendarItem = React.forwardRef<
}
} else {
const viewPosition = Math.round(currentScrollTop + viewHeight)
if (
viewPosition <
state.monthsData[current].cssScrollHeight +
state.monthsData[current].cssHeight &&
currentScrollTop > state.monthsData[current - 1].cssScrollHeight
) {
current -= 1
}
if (
current + 1 <= state.monthsNum &&
viewPosition >=
Expand Down

0 comments on commit 9215097

Please sign in to comment.