Change time to the one I entered.
Time does not change.

react-datepicker v2.0.0
import DatePicker from 'react-datepicker';
...
<DatePicker
id={code}
selected={value}
onChange={(date) => { this.setState({ value: date }); }}
showTimeSelect
timeFormat="HH:mm"
dateFormat="dd/MM/yyyy HH:mm:ss"
/>
try using onChangeRaw
<DatePicker
id={code}
selected={value}
onChange={(date) => { this.setState({ value: date }); }}
onChangeRaw={(date) => { this.setState({ value: date }); }}
showTimeSelect
timeFormat="HH:mm"
dateFormat="dd/MM/yyyy HH:mm:ss"
/>
onChangeRaw returns event, not date.
And I think it should act the same way when you change one number in time (now it does not work) and when you change the whole time (everything works).

If someone can point me in the right direction, I would try fixing this. It seems like the picker is currently really broken to users.
Maybe it will be useful: in my case i've made a mistake in dateFormat prop, so manual input was broken although choosing dates in dropdown worked.
On official page https://reactdatepicker.com there are all examples have same functional.
And i found one decision to use onChangeRaw
In official page you can't change time manually. But you can change date manually. I think it's strange when one part of input works fine and the other works not fine.
@martijnrusschen Are there plans to fix this issue ? By when can we expect this to be resolved ?
As @mxsmirnoff mentions, all of the examples on the official website are broken. Changing the time manually on any of those resets to the previous value. This is particularly obvious (and bad UX) when using showTimeSelectOnly, and I have to explain to users that they need to use the popover for now. I'd love to create a PR but unfortunately it's beyond my current skillset. I'd be super grateful for a fix!
Does anyone have a workaround for now? onChangeRaw does not work for me.
@jdahdah I did something like this with onChangeRaw to solve this
<DatePicker
id={code}
selected={value}
onChange={(date, event) => {
if (!(event && event.target.value)) {
this.handleChange(code, date);
}
}}
onChangeRaw={(event) => {
this.handleChangeRaw(code, dateFormat, dateTimeFormat, event.target.value);
}}
showTimeSelect
timeFormat="HH:mm"
dateFormat={dateTimeFormat}
/>
...
handleChangeRaw = (code, dateFormat, dateTimeFormat, value) => {
if (isValid(parse(value, dateTimeFormat, new Date()))) {
this.handleChange(code, parse(value, dateTimeFormat, new Date()));
} else if (isValid(parse(value, dateFormat, new Date()))) {
this.handleChange(code, parse(value, dateFormat, new Date()));
} else {
this.handleChange(code, null);
}
};
Most helpful comment
@martijnrusschen Are there plans to fix this issue ? By when can we expect this to be resolved ?