diff --git a/src/FormularioInput.vue b/src/FormularioInput.vue index 61245ce..5bad20d 100644 --- a/src/FormularioInput.vue +++ b/src/FormularioInput.vue @@ -276,7 +276,11 @@ export default class FormularioInput extends Vue { @Watch('proxy') onProxyChanged (newValue, oldValue): void { - this.performValidation() + if (this.errorBehavior === ERROR_BEHAVIOR.LIVE) { + this.performValidation() + } else { + this.validationErrors = [] + } if (!this.isVmodeled && !shallowEqualObjects(newValue, oldValue)) { this.context.model = newValue } diff --git a/test/unit/FormularioInput.test.js b/test/unit/FormularioInput.test.js index 81057ce..8ab155e 100644 --- a/test/unit/FormularioInput.test.js +++ b/test/unit/FormularioInput.test.js @@ -58,6 +58,33 @@ describe('FormularioInput', () => { expect(wrapper.find('span').exists()).toBe(false) }) + it('no validation on value change when errorBehavior is not live', async () => { + const wrapper = mount(FormularioInput, { + propsData: { + name: 'test', + validation: 'required|in:abcdef', + validationMessages: {in: 'the value was different than expected'}, + errorBehavior: 'submit', + value: 'other value' + }, + scopedSlots: { + default: `