Skip to content

Conversation

@XiNiHa
Copy link

@XiNiHa XiNiHa commented Oct 16, 2020

🔎 Overview

This PR adds the feature to disable automatic v-model detection.

🤓 Code snippets/examples (if applicable)

Ignoring the v-modeled element and using validate() to validate the second input's value instead.

<ValidationProvider v-slot="{ validate }" :detectInput="false">
    <input v-model="field" type="text"> <!-- not detected -->
    <input type="text" @change="validate($event.target.value)">
</ValidationProvider>

Issues affected

closes #2979

@codecov
Copy link

codecov bot commented Oct 16, 2020

Codecov Report

Merging #2980 into master will not change coverage.
The diff coverage is 92.30%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2980   +/-   ##
=======================================
  Coverage   95.70%   95.70%           
=======================================
  Files          51       51           
  Lines        1350     1350           
  Branches      329      329           
=======================================
  Hits         1292     1292           
  Misses         58       58           
Impacted Files Coverage Δ
src/components/Provider.ts 93.93% <92.30%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1522e4e...5ac7568. Read the comment docs.

Copy link
Owner

@logaretm logaretm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Do you mind adding tests for this? Should be similar to the most basic test but instead of checking that error messages are rendered, you would check if they didn't since the input wasn't detected.

@logaretm logaretm changed the title feat: added detectInput closes #2979 feat: added detectInput Oct 16, 2020
@XiNiHa XiNiHa requested a review from logaretm October 16, 2020 01:08
@XiNiHa XiNiHa requested a review from logaretm October 16, 2020 01:29
@logaretm logaretm merged commit 6d7d1c4 into logaretm:master Oct 16, 2020
@logaretm
Copy link
Owner

Great work, thank you!

@logaretm
Copy link
Owner

I tagged 3.4.2 with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Way to Disable Automatic v-model Detection?

2 participants