Skip to content

Commit

Permalink
fix: picker 组件在小程序端触发滚动后,页面(有滚动条的情况下)也一起滚动 (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaniceZ authored Mar 20, 2023
1 parent ea636ff commit 4d5891c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/packages/picker/picker.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, {
RefObject,
ForwardRefRenderFunction,
} from 'react'
import { View } from '@tarojs/components'
import Popup from '@/packages/popup/index.taro'
import PickerSlot from './pickerSlot.taro'
import useRefs from '@/utils/useRefs'
Expand Down Expand Up @@ -287,7 +288,12 @@ const InternalPicker: ForwardRefRenderFunction<unknown, Partial<PickerProps>> =
closeActionSheet()
}}
>
<div className={`${b()} ${className || ''}`} style={style} {...rest}>
<View
className={`${b()} ${className || ''}`}
style={style}
{...rest}
catchMove
>
{renderToolbar()}
<div className={b('panel')} ref={pickerRef}>
{columnsList?.map((item, index) => {
Expand All @@ -308,7 +314,7 @@ const InternalPicker: ForwardRefRenderFunction<unknown, Partial<PickerProps>> =
)
})}
</div>
</div>
</View>
</Popup>
)
}
Expand Down

0 comments on commit 4d5891c

Please sign in to comment.