question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

does'n change inputValue (check in calendar) after onChangeRaw event

See original GitHub issue

Expected 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:closed
  • Created 6 years ago
  • Comments:15

github_iconTop GitHub Comments

8reactions
tcollinscommented, Feb 16, 2018

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.

5reactions
nick-vanvyncktcommented, Mar 27, 2018

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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Datepicker( can't get value of input) - Stack Overflow
I want to get value of input, when I change date. If i click on 20th October 2017, i want put 20th October...
Read more >
React Datepicker crafted by HackerOne
A simple and reusable datepicker component for React.
Read more >
How to Handle Input Value Changes in React
To update the input value and set it in the state of our component, first we have to add: const [title, setTitle] =...
Read more >
Hint: Date Picker component and input onChange event.
In 2nd attempt I see, that input value changes in UI, and I expect that ... This event works fine with input without...
Read more >
React custom datepicker: Step-by-step - LogRocket Blog
Go ahead and update the calendar component to include the following code snippet for the event handlers: const gotoDate = (date) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found