Code used in example
class ExampleCustomInput extends React.Component {
render () {
return (
<button
className="example-custom-input"
onClick={this.props.onClick}>
{this.props.value}
</button>
)
}
}
ExampleCustomInput.propTypes = {
onClick: PropTypes.func,
value: PropTypes.string
};
...
<DatePicker
customInput={<ExampleCustomInput />}
selected={this.state.startDate}
onChange={this.handleChange} />
this is indeed an issue.
Seeing the same thing.
I found a way... the customInput element should has to use the onKeyDown-event (that gets passed to the custom input element by the DatePicker)
class ExampleCustomInput extends React.Component {
render () {
return (
<button
onKeyDown={this.props.onKeyDown}
className="example-custom-input"
onClick={this.props.onClick}>
{this.props.value}
</button>
)
}
}
i found this, analyzing the code... i think this should be mentioned in the documentation!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
I found a way... the customInput element should has to use the onKeyDown-event (that gets passed to the custom input element by the DatePicker)
i found this, analyzing the code... i think this should be mentioned in the documentation!