Skip to content

Picker disappears when scrolling too fast (When Using Virtualized Wheel Picker) #50

Description

@a25osman

When scrolling too fast with a VirtualizedWheelPicker, the picker data disappears from view (I think it moves off screen).

Minimal Reproducible Example you can try in an expo snack

import { Text, SafeAreaView, View, StyleSheet } from 'react-native';

import { useState } from 'react';
import WheelPicker, {
  withVirtualized,
} from '@quidone/react-native-wheel-picker';

const weightIntegersData = Array.from({ length: 499 }, (_, i) => ({
  value: i + 40,
}));

const VirtualizedWheelPicker = withVirtualized(WheelPicker);

export default function App() {
  const [weightInteger, setWeightInteger] = useState(150);
  return (
    <SafeAreaView style={styles.container}>
      <View style={{ flex: 1, justifyContent: 'center' }}>
        <VirtualizedWheelPicker
          data={weightIntegersData}
          value={weightInteger}
          onValueChanged={({ item: { value } }) => setWeightInteger(value)}
          enableScrollByTapOnItem
        />
      </View>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    backgroundColor: '#ecf0f1',
    padding: 8,
  },
});

ScreenRecording.picker.bug.disappearing.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions