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(Field): should not modify the value if it's within the min/max #13282

Merged
merged 1 commit into from
Feb 9, 2025

Conversation

dgmpk
Copy link
Contributor

@dgmpk dgmpk commented Dec 23, 2024

在 type 为 number 或 digit 时,如果没有设置 min 或 max,onblur 时值 1.00 不会有变化,但当设置了 min 或 max 时,onblur 会触发非必要的格式化,导致值 1.00 变成 1。

@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.66%. Comparing base (ec5b45b) to head (f00a3d2).
Report is 27 commits behind head on main.

Files with missing lines Patch % Lines
packages/vant/src/field/Field.tsx 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13282      +/-   ##
==========================================
+ Coverage   89.60%   89.66%   +0.05%     
==========================================
  Files         257      257              
  Lines        7013     7014       +1     
  Branches     1736     1737       +1     
==========================================
+ Hits         6284     6289       +5     
+ Misses        384      380       -4     
  Partials      345      345              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@inottn
Copy link
Collaborator

inottn commented Dec 23, 2024

Could you please add a test for the case? Thanks.

@chenjiahan chenjiahan changed the title fix(field): fix unexpected formatting fix(Field): should not modify the value if it's within the min/max Feb 9, 2025
Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

👍

@chenjiahan chenjiahan merged commit b420f36 into youzan:main Feb 9, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants