Skip to content

Commit

Permalink
fix: don't sync the value in an event handler closes #2185
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Jul 26, 2019
1 parent 7aff37b commit 50c4d7e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/provider.js
Expand Up @@ -170,7 +170,7 @@ export const ValidationProvider = {
/* istanbul ignore next */
if (!isCallable(slot)) {
if (process.env.NODE_ENV !== 'production') {
warn('ValidationProvider expects a scoped slot. Did you forget to add "v-slot" to your slot?');
warn('ValidationProvider expects a scoped slot. Did you forget to add "v-slot"?');
}

return h(this.tag, this.$slots.default);
Expand Down Expand Up @@ -329,7 +329,7 @@ export function onRenderUpdate (model) {

const validateNow = shouldValidate(this, model);
this._needsValidation = false;
this.value = model.value;
this.syncValue(model.value);
this._ignoreImmediate = true;

if (!validateNow) {
Expand All @@ -342,7 +342,6 @@ export function onRenderUpdate (model) {
// Creates the common handlers for a validatable context.
export function createCommonHandlers (ctx) {
const onInput = (e) => {
ctx.syncValue(e); // track and keep the value updated.
ctx.setFlags({ dirty: true, pristine: false });
};

Expand Down Expand Up @@ -379,6 +378,10 @@ export function createCommonHandlers (ctx) {
ctx.$veeDebounce = ctx.debounce;
}

onValidate._vee_isUnique = true;
onBlur._vee_isUnique = true;
onInput._vee_isUnique = true;

return { onInput, onBlur, onValidate };
}

Expand Down

0 comments on commit 50c4d7e

Please sign in to comment.