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.
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.