Comparing version 0.1.3 to 0.1.4
@@ -28,3 +28,2 @@ import Ember from 'ember'; | ||
hasLostFocus: false, | ||
hasInitialFocus: false, | ||
@@ -84,5 +83,5 @@ wrapped: oneWay('form.wrapped'), | ||
validClass: computed('errors.[]', 'field-name', 'canShowErrors', 'errorText', 'hasFocusedOnce', 'shouldShowValidationErrors', { | ||
validClass: computed('errors.[]', 'model.errors', 'field-name', 'canShowErrors', 'errorText', 'hasFocusedOnce', 'shouldShowValidationErrors', { | ||
get() { | ||
return this._getValidClass(get(this, 'model.errors'), get(this, 'field-name')); | ||
return this._getValidClass(get(this, 'errors.length'), get(this, 'model.errors'), get(this, 'field-name')); | ||
} | ||
@@ -93,3 +92,2 @@ }), | ||
set(this, 'hasLostFocus', false); | ||
set(this, 'hasInitialFocus', true); | ||
}, | ||
@@ -110,3 +108,3 @@ | ||
*/ | ||
_getValidClass(modelErrors, fieldName) { | ||
_getValidClass(errorsCount, modelErrors, fieldName) { | ||
if (get(this, 'hasFocusedOnce') || get(this, 'shouldShowValidationErrors')) { | ||
@@ -117,4 +115,6 @@ if (this._hasDSError(modelErrors, fieldName)) { | ||
return get(this, 'canShowErrors') ? 'is-invalid' : 'is-valid'; | ||
return (get(this, 'canShowErrors') || errorsCount > 0) ? 'is-invalid' : 'is-valid'; | ||
} | ||
return; | ||
}, | ||
@@ -121,0 +121,0 @@ |
{ | ||
"name": "ya-input", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "The default blueprint for ember-cli addons.", | ||
@@ -5,0 +5,0 @@ "directories": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9506
183