farhoudshapouran / react-native-ui-datepicker

Customizable React Native 📅 DatePicker component for Android, iOS, and Web. It includes single, range and multiple modes and supports different locales.
https://farhoudshapouran.github.io/react-native-ui-datepicker/
MIT License
272 stars 28 forks source link

Scrolling Issue on Time Picker #82

Closed asergb-churon closed 1 month ago

asergb-churon commented 2 months ago

Summarized code:

import { Dropdown } from 'react-native-element-dropdown';
export default function App() {
    const [eventDate, setEventDate] = useState();
    return (
        <ScrollView>
            <View style={styles.container}>
                <View>
                    <Text>Date of Event: {eventDate}</Text>
                    <DateTimePicker
                        date={eventDate}
                        timePicker
                        todayContainerStyle={{
                            borderWidth: 1,
                        }}
                        onChange={params => setEventDate(params.date)}
                    />
            </View>
        </ScrollView>
    );
}

Concern:

  1. I selected a date
  2. Clicked on the time
  3. Time picker view shows up
  4. When I try to scroll up or down to select the time, the app registers as me scrolling the entire app view up or down, while time picker itself is lagging.

I suspect the component isn't designed to ignore ScrollView by default, is this an expected behavior?

farhoudshapouran commented 1 month ago

Please upgrade to the latest version I changed the time picker component. https://github.com/farhoudshapouran/react-native-ui-datepicker/commit/e7d93648680d4f10ee5aec77244d633abe128254