I added readOnly props to datePicker component but when I using this props, then the component is not working but if I remove it, it's working.
NOTE: This problem was not available before.
I should be work with datePicker while it has readOnly props.
For some reason this was changed in https://github.com/Hacker0x01/react-datepicker/pull/1419
Here's the solution I came up with: https://github.com/Hacker0x01/react-datepicker/issues/1443#issuecomment-416531351
The change in #1419 broke us as well. I'm also in favor of reverting it. Until then, here is our workaround:
const ForceReadOnlyInput = React.forwardRef((props, ref) => (
<input {...props} ref={ref} readOnly={true} />
));
<ReactDatePicker
customInput={<ForceReadOnlyInput />}
/>
It would have been nice to just pass customInput={<input readOnly={true} />}, but the library overwrites the attribute during render.
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
The change in #1419 broke us as well. I'm also in favor of reverting it. Until then, here is our workaround:
It would have been nice to just pass
customInput={<input readOnly={true} />}, but the library overwrites the attribute during render.