From 95f6b17e3bdfae538373a2b05270b40acaaac8f1 Mon Sep 17 00:00:00 2001 From: rthoward Date: Thu, 11 Oct 2018 16:55:48 -0400 Subject: [PATCH 1/2] Simplify "anything" input validatin regex --- js/lib/input_validations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/lib/input_validations.js b/js/lib/input_validations.js index c14b958d..13134644 100644 --- a/js/lib/input_validations.js +++ b/js/lib/input_validations.js @@ -5,7 +5,7 @@ import createAutoCorrectedDatePipe from 'text-mask-addons/dist/createAutoCorrect export default { anything: { mask: false, - match: /^(?!\s*$).+/, + match: /\s*/, unmask: [], validationError: 'Please enter a response' }, From c435c364751e69a086ddc3aed8e923b207050a7f Mon Sep 17 00:00:00 2001 From: rthoward Date: Thu, 11 Oct 2018 16:56:12 -0400 Subject: [PATCH 2/2] Don't showValid if input value is empty --- js/components/text_input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/components/text_input.js b/js/components/text_input.js index 883e0a75..7663b957 100644 --- a/js/components/text_input.js +++ b/js/components/text_input.js @@ -95,7 +95,7 @@ export default { } else if (invalidate) { this.showError = true } - this.showValid = valid + this.showValid = this.value != "" && valid // Emit a change event this.$root.$emit('field-change', {