You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can work around it by triggering the react event yourself.
// If we have a date input and it has a picker attribute bind the event
componentDidUpdate() {
if(this.dateInput && this.dateInput.hasAttribute('data-has-picker')) {
this.dateInput.addEventListener('change', this.startDateChanged);
}
}
// Cleanup before re-render
componentWillUpdate() {
if(this.dateInput && this.dateInput.hasAttribute('data-has-picker')) {
this.dateInput.removeEventListener('change', this.startDateChanged);
}
}
// In your render function store a reference to the polyfilled input
render() {
return (
<input
type="date"
value={startDate}
onChange={this.startDateChanged}
ref={(input) => { this.dateInput = input; }}
/>);
}
When choosing a date through datepicker, the onchange event of the input is not triggered.
So it can not be used with React.
The text was updated successfully, but these errors were encountered: