-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Time Conductor] Don't update model while typing #324
Conversation
Validate while a user types, but only update the underlying value in the model on a blur event. #259
...to reflect changes to when validation and model updates occur.
When pressing enter (e.g. submitting) text input into data-time fields, update the underlying model (as done on tab out.)
...to reflect that a date-time field is only invalid while the user is still entering bad input (will be reset to a valid state on blur etc.)
...when tabbing out and/or submitting bad input.
Author Checklist
* Original issue is not reproducible after these changes but only a subset of the designed solution is implemented; filed #325 as a follow-up issue to address this. |
This is some nonstandard stuff-- we should implement forms according to the HTML spec and use common form handling standards. Otherwise, we will have inferior experience on different devices and be unusable to anyone with assistive devices, and our code will get quite convoluted; user agents provide considerable assistance in handling forms-- they will handle the things that would normally trigger form submit, and often will provide better form navigation tools. Basically:
(This is yet another reason why angular two-way binding is a mess; it often subverts proper form handling behavior) Here's basic form entry on iPhone; note the functionality it picks up from being a form: So, to provide time-conductor specific feedback:
The edit properties dialogue also needs the same treatment, as it has similar issues. I would save so much time if I could press "enter" after typing a folder name to save it. Since that is out of scope for this issue, we can file a follow-up for that to bring forms back in line with HTML standards. Sending back to @VWoeltjen. |
Closing this PR; essentially a rewrite of these changes is called for above, makes sense to start from a new branch. |
Instead of updating the underlying model for values from a date-time fields during typing, do so only when user input is complete (on a blur and/or submit.) If text is invalid when user input is complete, restore it to a valid state.
This prevents constraints in the time conductor from being enforced prematurely (while the user is typing), which can result in undesired behavior as shown in #259.
Note that this does not include any visual indication of constraint violation (e.g. start is greater than end time), as described in this comment of the original issue. Will file a follow up issue for these cases; submitting to merge in its current state due to impending code freeze. (Changes are sufficient to make #259 irreproducible.)