Eliminates use of callback on setState to call this.props.onChange which was causing an issue with caret position resetting when you initially keyboard edit a newly selected date (on a controlled date picker).
Motivation and Context
This fixes the issue #831
Keyboard edits to controlled datepicker is a very common use case. Currently for a date like 11/11/1988, if a user wants to change month 11 to month 9, when to replace month 11, the caret will snap to the end. This can get very annoying if a user needs to use the keyboard edits to quickly fix a date and they must do this many times throughout a session.
Checklist
[ x ] I have not included any built dist files (us maintainers do that prior to a new release)
[ ] I have added tests covering my changes
[ ] All new and existing tests pass
[ ] My changes required the documentation to be updated
[ ] I have updated the documentation accordingly
[ ] I have updated the TypeScript 1.8 type definitions accordingly
[ ] I have updated the TypeScript 2.0+ type definitions accordingly
Description
Eliminates use of callback on
setState
to call this.props.onChange which was causing an issue with caret position resetting when you initially keyboard edit a newly selected date (on a controlled date picker).Motivation and Context
This fixes the issue #831
Keyboard edits to controlled datepicker is a very common use case. Currently for a date like 11/11/1988, if a user wants to change month
11
to month9
, when to replace month11
, the caret will snap to the end. This can get very annoying if a user needs to use the keyboard edits to quickly fix a date and they must do this many times throughout a session.Checklist