Skip to content
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

The time picker hit some race condition and is buggy when using a controlled value #827

Open
paintoshi opened this issue Apr 10, 2022 · 0 comments

Comments

@paintoshi
Copy link

I'm Submitting a ...

[ x ] Bug report
[ ] Feature request
[ ] Support request

Steps to Reproduce

I'm using the datepicker value in order to update it programmatically. From what I can find on the docs, this should be the correct way of doing it.

const [curentDate, setCurentDate] = React.useState(initValue)
const onChangeDate = (date: any) => {
    setCurentDate(date)
}
<Datetime
    value={curentDate}
    onChange={onChangeDate}
    ....

Expected Results

Selecting a date and time should be smooth.

Actual Results

Selecting the date is fine, but when increasing/desceasing hours/min it works about 50% of the time. It instantly switches back to the previous value. Removing "value" from the datePicker and using the initalValue instead solves the problem, but then I can't change the date from other components.

chrome_1pYEedriDb.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant