datePicker: model isn't updated until 500ms has passed since the last edit
Actual Behavior:
What is the issue?*
My setup: I have a datePicker in a dialog, and when the dialog closes, I try to submit the data from the datePicker to my server.
If a user enters data into the datePicker and closes the dialog in less than 500ms, stale or otherwise invalid data gets sent to the server, because datePicker hasn't updated my model.
The general problem, I think, is that the debouncing in datePicker is too aggressive, and the datePicker component provides no way to force it to sync with the model. You're just stuck waiting for 500ms.
What is the expected behavior?
I think it's reasonable to sync to the model on blur, because the blur event is a good indication that the user has finished entering data into the input field.
CodePen (or steps to reproduce the issue): *
CodePen Demo which shows your issue:Details:
You can see the impact of the 500ms delay on the Datepicker demo at https://material.angularjs.org/latest/demo/datepicker :
- Put your cursor in the textbox under "Standard date-picker"
- Quickly enter a new date and press tab
- Note that it takes 500ms before the other date pickers are synced with the first one
Angular Versions: *
Angular Version:1.5Angular Material Version:Noted on 1.0.9
Additional Information:
Browser Type: *ChromeBrowser Version: *51.0.2704.106 (64-bit)OS: *UbuntuStack Traces:N/A
We've already had it in mind to be able to reduce the debounce interval (https://github.com/angular/material/issues/8450). I'll continue tracking it here.