does'n change inputValue (check in calendar) after onChangeRaw event
See original GitHub issueExpected behavior
Actual behavior
does’n change inputValue (when check in calendar) after onChangeRaw event
Steps to reprodcue
Do onChangeRaw event, and choose other date.
I have next props
<DatePicker selected={selected ? moment(selected, 'DD.MM.YYYY HH:mm') : defaultDate ? defaultDate : moment()} onChange={this.handleOnChange} customInput={<CustomInput />} showTimeSelect locale="ru" timeFormat="HH:mm" dateFormat={dateFormat} minDate={moment(minDate, 'DD.MM.YYYY HH:mm')} onChangeRaw={(event) => { this.handleChangeRaw(event.target.value) }} />
and
`class CustomInput extends React.Component { static propTypes = { onClick: React.PropTypes.func, onChange: React.PropTypes.func, value: React.PropTypes.string }
render () {
return (
<input
className="example-custom-input"
onClick={this.props.onClick}
value={this.props.value}
onChange={this.props.onChange}
/>
)
}
}`
Issue Analytics
- State:
- Created 6 years ago
- Comments:15
I am seeing a similar thing. After editing the input directly, which triggers the onChangeRaw method. If I click on a day in the calendar, it works and actually gets everything working correctly again, but if I click on a different time, my state is updated, but the value displayed in the input is not updated and there is a disconnect between the state value vs the input value.
I’m having a similar problem with the state value not being in sync with the input value. I have a dropdown box next to my date range where you can choose from a couple presets. Once the user manually changes the input fields, the datepicker input value will no longer update to the correct value (although I can see the datepicker working correctly and selecting the correct date in the pop-up).