danielmoncada / date-time-picker

Angular Date Time Picker (Responsive Design)
https://daniel-projects.firebaseapp.com/owlng/date-time-picker
MIT License
140 stars 60 forks source link

Don't reformat input while field is focused #124

Closed komu closed 2 years ago

komu commented 3 years ago

Never normalize the input value for field while it is focused, but do it immediately upon losing focus.

Previously code for handling input had a 500 ms debounce so that if user was fast enough, they could type '17' in the field. If the 500 ms passed between 1 and 7, then the text would change to '01' in the middle of typing and the keystroke for 7 would be lost, confusing the user.

Related problem with the old debounce implementation was that the value was not visible outside the component before 500 ms had passed. If user typed a value and the immediately closed the dialog, the value would be lost.

danielmoncada commented 2 years ago

@komu thanks, merged. Will be in v12.2