From c70d928b9aac2dc4b206b355a23c5642a5942f24 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Thu, 14 Mar 2019 13:34:19 -0400 Subject: [PATCH] Move formatting into onBlur --- js/components/text_input.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/components/text_input.js b/js/components/text_input.js index e41bf049..98234f4d 100644 --- a/js/components/text_input.js +++ b/js/components/text_input.js @@ -79,14 +79,15 @@ export default { onChange: function(e) { // Only invalidate the field when it blurs this._checkIfValid({ value: e.target.value, invalidate: true }) - if (this.validation === 'dollars') { - this.value = formatDollars(this._rawValue(e.target.value)) - } }, onBlur: function(e) { this._checkIfValid({ value: e.target.value.trim(), invalidate: true }) this.value = e.target.value.trim() + + if (this.validation === 'dollars') { + this.value = formatDollars(this._rawValue(e.target.value)) + } }, //