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

fix: handle v-model.trim and v-model.number #2408

Merged
merged 4 commits into from Oct 8, 2019
Merged

fix: handle v-model.trim and v-model.number #2408

merged 4 commits into from Oct 8, 2019

Conversation

logaretm
Copy link
Owner

@logaretm logaretm commented Oct 8, 2019

🔎 Overview

This PR handles both v-model.trim and v-model.number modifiers, The ValidationProvider component uses both v-model and input event to keep the value tracked, but when one of the two modifiers used, it will end up with 2 different values between re-renders, causing stuff like eager mode to break due to it thinking the value changed already in-between the renders.

This PR enhances the value normalization, by casting the value to number using parseFloat when the number modifier is used. And String.trim if the trim modifier is used.

Issues affected

closes #2403

@codecov
Copy link

codecov bot commented Oct 8, 2019

Codecov Report

Merging #2408 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2408      +/-   ##
=========================================
+ Coverage   95.27%   95.3%   +0.03%     
=========================================
  Files          44      44              
  Lines        1058    1065       +7     
  Branches      159     162       +3     
=========================================
+ Hits         1008    1015       +7     
  Misses         50      50
Impacted Files Coverage Δ
src/utils/events.ts 100% <100%> (ø) ⬆️

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 dda9abb...4861793. Read the comment docs.

@logaretm logaretm merged commit bf4a566 into master Oct 8, 2019
@logaretm logaretm deleted the fix/2403 branch October 8, 2019 01:08
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.

eager mode doesn't work with v-model.number
1 participant