-
-
Notifications
You must be signed in to change notification settings - Fork 423
add debounce prop #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
hello, I'm not quite sure what you mean here. Can you please post a code snippet that manifests the problem? Thanks! |
@vonovak I might be having the same issue here but I don't think that including a debounce to the onChange function will help. Basically, when a user changes one part of the date picker then moves a different part while the component is still updating/refreshing, it will move back to the first date. See gif here: I know it's probably hard to tell when I'm taping, but here I change the month and then immediately the date and it keeps going back to the original date because the component's value is still stuck on the old date or maybe just rerendered. It would be nice if the value of the date picker wasn't controlled by the state and instead gave us the value instead, sort of like an input. Is there a way to make that happen? This issue is especially bad on slower phones. |
I ran into the same problem. In my case, I am implementing a custom DateTime picker based on this datetimepicker. Among other props I have import React, { useRef } from 'react';
import DateTimePicker from '@react-native-community/datetimepicker';
const DateTimePickerMemoized = React.memo(props => <DateTimePicker {...props} />);
const CustomDateTimePicker = ({ value, ...props }) => {
const initial = useRef(value);
return <DateTimePickerMemoized
value={initial.current}
{...props}
/>;
};
export default CustomDateTimePicker; |
I can confirm this is a real issue and @merissaacosta explained well. UpdateNo success. In the end both libraries use the native date picker so the result was the same, unfortunately. |
It's hard to help without a source code and steps to reproduce the problem, I understand the problem but I can't reproduce. I suggest test with the |
I understand this issue is duplicated please continue the discussion in this issue |
I am using the date picker with expo. It works fine except, that the user almost has no time to really adjust the date.
As soon as you lift your finger from either day, month or year the component refreshes. The problem is with that handling that you can't really change 1 or more numbers of a date.
I debounce the date change function in order to give the user time to really adjust the date. As often you want to change the day and month...
thanks!
The text was updated successfully, but these errors were encountered: