Skip to content

Commit ae676a4

Browse files
committed
chore(Picker): fix android onTouchEnd in ScrollViewPorps 失效
1 parent d9dd487 commit ae676a4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/Picker/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
Animated,
1313
NativeSyntheticEvent,
1414
NativeScrollEvent,
15+
Platform,
1516
} from 'react-native';
1617

1718
export interface PickerDate {
@@ -143,7 +144,8 @@ const Picker = (props: PickerProps) => {
143144
onTouchEnd={setScrollY}
144145
onScroll={Animated.event([{ nativeEvent: { contentOffset: { y: Y } } }], {
145146
listener: (event: NativeSyntheticEvent<NativeScrollEvent>) => {
146-
if (onPressORonScroll.current === 'onPress' || !isTouchEnd.current) {
147+
const flag = Platform.OS === 'android' ? false : !isTouchEnd.current;
148+
if (onPressORonScroll.current === 'onPress' || flag) {
147149
return false;
148150
}
149151
isScroll.current = false;

0 commit comments

Comments
 (0)