Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add standalone prop for fields #3379

Merged
merged 2 commits into from Jul 10, 2021
Merged

feat: add standalone prop for fields #3379

merged 2 commits into from Jul 10, 2021

Conversation

logaretm
Copy link
Owner

@logaretm logaretm commented Jul 6, 2021

What

Sometimes it is useful to have non-controlled inputs, that is inputs that are not tracked by the form.

These inputs typically do not contribute to the form values, nor they have any validation in place other than simple type checks.

A couple of examples on these inputs:

  • User choosing an option between A and B with either a radio or select input, which will show some conditional fields based on the selection.
  • Fields that will get processed separately without the other inputs in the form

How

This PR adds a standalone configuration property on both Field and useField, this prop allows the field to not be picked up by the form context.

It blocks the inject API in the useField function

@logaretm logaretm changed the title feat: added standalone prop for fields feat: add standalone prop for fields Jul 6, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2021

Codecov Report

Merging #3379 (b52ac06) into main (d930271) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3379   +/-   ##
=======================================
  Coverage   96.70%   96.70%           
=======================================
  Files          65       65           
  Lines        1607     1607           
  Branches      387      389    +2     
=======================================
  Hits         1554     1554           
  Misses         52       52           
  Partials        1        1           
Impacted Files Coverage Δ
packages/vee-validate/src/Field.ts 94.59% <ø> (ø)
packages/vee-validate/src/useField.ts 98.86% <100.00%> (ø)

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 d930271...b52ac06. Read the comment docs.

@logaretm logaretm merged commit 3689437 into main Jul 10, 2021
@logaretm logaretm deleted the feat/standalone-fields branch July 10, 2021 16:59
logaretm added a commit that referenced this pull request Jul 19, 2021
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.

None yet

2 participants