-
Notifications
You must be signed in to change notification settings - Fork 4
axInput should check validation on blur, not on keypress #32
Comments
- implemented ngModelOptions.updateOn forward-compatible to AngularJS 1.3 - implemented configuration option lib.laxar_uikit.controls.input.ngModelOptions to set the global default
* feature/32-check-input-on-blur-not-on-keypress-rebase: (#32) Allowed to trigger model updates through user defined events: - implemented ngModelOptions.updateOn forward-compatible to AngularJS 1.3 - implemented configuration option lib.laxar_uikit.controls.input.ngModelOptions to set the global default
Upgrade InformationBy default, text input fields using This can be beneficial to performance and to user experience (the user is not confused with error messages for an incomplete input). Per-Field ConfigurationTo change the behavior on a per-field-basis, set the In this example, the length validation (and the model update) will only be performed when the input field loses focus: <input type="text"
data-ng-model="myModel.myValue" data-ng-model-options="focusout"
data-ax-input data-ax-input-maximum-length="10"> Global ConfigurationTo globally override the default provided by AngularJS (update on every keypress), a global default may be set using the configuration option More InformationAngularJS 1.3 will also introduce the property |
* feature/32-check-input-on-blur-not-on-keypress-fix-specs: (#32) fixed spec test
Sometimes, the input validation state and model should not be updated on every keypress, but instead whenever the user tabs out of an input field.
AngularJS 1.3 will ship with
ngModelOptions
which allows to specify something like{ updateOn: "focusout keypress" }
per field to achieve this. Because it is very error-prone to have to set this on eachngModel
(and still keep things configurable app-by-app), the default should be controlled by a LaxarJS configuration option, and should be picked up byaxInput
.The text was updated successfully, but these errors were encountered: