Skip to content

feat(Field): password field supports showing and hiding the password#13567

Open
keeplearning66 wants to merge 6 commits intoyouzan:mainfrom
keeplearning66:feat/field-password
Open

feat(Field): password field supports showing and hiding the password#13567
keeplearning66 wants to merge 6 commits intoyouzan:mainfrom
keeplearning66:feat/field-password

Conversation

@keeplearning66
Copy link
Contributor

@keeplearning66 keeplearning66 commented Jul 24, 2025

This PR is to close #13565

I added showPasswordIcon prop to support showing and hiding the password.

showPasswordIcon: used for users to set whether the password icon should be displayed
showPwdIcon: used for internal confirmation of whether the password icon should be displayed, as there may be situations where it is not necessary to show the password icon
passwordIcon: used to confirm the type of the password icon, which can be either eye-o or closed-eye
showPassword: used to confirm whether the password field should display the password
selectionInfo: used to record the cursor's position, and maintain focus when the password icon is clicked

After modification

20250725_090039.mp4

I have added the corresponding unit tests

@codecov-commenter
Copy link

codecov-commenter commented Jul 24, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.68%. Comparing base (ec5b45b) to head (b82fdab).
⚠️ Report is 177 commits behind head on main.

Files with missing lines Patch % Lines
packages/vant/src/field/Field.tsx 75.00% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13567      +/-   ##
==========================================
+ Coverage   89.60%   89.68%   +0.08%     
==========================================
  Files         257      257              
  Lines        7013     7060      +47     
  Branches     1736     1750      +14     
==========================================
+ Hits         6284     6332      +48     
- Misses        384      386       +2     
+ Partials      345      342       -3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@001cici
Copy link

001cici commented Sep 12, 2025

When will this function be available online?

@keeplearning66
Copy link
Contributor Author

I'm not sure either — this PR still hasn't been reviewed.

@001cici
Copy link

001cici commented Sep 12, 2025 via email

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.

密码框组件在显示隐藏密码功能在 chrome浏览器不显示

3 participants

Comments