Merge pull request #707 from dod-ccpo/clin-trailing-zeros-fix

Move formatting into onBlur
This commit is contained in:
leigh-mil 2019-03-15 10:06:48 -04:00 committed by GitHub
commit 8a3c65ff25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,14 +79,15 @@ export default {
onChange: function(e) { onChange: function(e) {
// Only invalidate the field when it blurs // Only invalidate the field when it blurs
this._checkIfValid({ value: e.target.value, invalidate: true }) this._checkIfValid({ value: e.target.value, invalidate: true })
if (this.validation === 'dollars') {
this.value = formatDollars(this._rawValue(e.target.value))
}
}, },
onBlur: function(e) { onBlur: function(e) {
this._checkIfValid({ value: e.target.value.trim(), invalidate: true }) this._checkIfValid({ value: e.target.value.trim(), invalidate: true })
this.value = e.target.value.trim() this.value = e.target.value.trim()
if (this.validation === 'dollars') {
this.value = formatDollars(this._rawValue(e.target.value))
}
}, },
// //