Skip to content

feat(Form): support tel type validator#56533

Merged
thinkasany merged 2 commits intoant-design:featurefrom
guoyunhe:feature-form-tel-validator
Jan 8, 2026
Merged

feat(Form): support tel type validator#56533
thinkasany merged 2 commits intoant-design:featurefrom
guoyunhe:feature-form-tel-validator

Conversation

@guoyunhe
Copy link
Contributor

@guoyunhe guoyunhe commented Jan 8, 2026

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ⌨️ Accessibility improvement
  • ❓ Other (about what?)

🔗 Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

💡 Background and Solution

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

📝 Change Log

Language Changelog
🇺🇸 English feat(Form): support tel type validator
🇨🇳 Chinese feat(Form): 支持 tel 类型校验

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @guoyunhe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces enhanced form validation capabilities by adding support for a 'tel' (telephone number) validation type. This new feature is enabled by upgrading the underlying @rc-component/form dependency and is documented in both English and Chinese to ensure developers are aware of its availability and usage.

Highlights

  • New Feature: Telephone Number Validation: The Form component now supports a 'tel' type validator, allowing for specific validation of telephone number inputs.
  • Documentation Update: Both English and Chinese documentation for the Form component have been updated to reflect the availability of the new 'tel' validation type.
  • Dependency Upgrade: The @rc-component/form dependency has been updated from version ~1.6.1 to ~1.6.2, which likely contains the implementation for the new 'tel' validator.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

👁 Visual Regression Report for PR #56533 Failed ❌

🎯 Target branch: feature (364bcc7)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🔄 1 changed

Expected (Branch feature) Actual (Current PR) Diff
list-vertical.dark.png list-vertical.dark.png list-vertical.dark.png list-vertical.dark.png

Important

There are 1 diffs found in this PR: 🔄 1 changed.
Please check all items:

  • Visual diff is acceptable

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

Preview is ready

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for the tel type validator in forms by updating a dependency and the corresponding documentation. The changes are a good addition. I've left one comment with suggestions to make the feature more complete by adding a demo, locale messages, and a changelog entry.

| required | Required field | boolean | |
| transform | Transform value to the rule before validation | (value) => any | |
| type | Normally `string` \|`number` \|`boolean` \|`url` \| `email`. More type to ref [here](https://github.com/react-component/async-validator#type) | string | |
| type | Normally `string` \|`number` \|`boolean` \|`url` \| `email` \| `tel`. More type to ref [here](https://github.com/react-component/async-validator#type) | string | |
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Thanks for adding support for the tel validator! To make this feature complete and improve the developer experience, could you please also:

  1. Add a demo: A working example would be very helpful. You could update the phone field in components/form/demo/register.tsx to use { type: 'tel' } in its validation rules.
  2. Add locale messages: The default validation message for the tel type should be added to the locale files (components/locale/en_US.ts and zh_CN.ts) for consistency.
  3. Fill out the changelog: Please add an entry for this new feature in the changelog section of the PR description.

These additions will make the new feature much easier for developers to discover and use.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 8, 2026

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (364bcc7) to head (61b9092).
⚠️ Report is 1 commits behind head on feature.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #56533   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          807       807           
  Lines        14867     14867           
  Branches      3935      3935           
=========================================
  Hits         14867     14867           

☔ 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.

@thinkasany
Copy link
Member

pin react-component/field-form#775

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 8, 2026
@codecov
Copy link

codecov bot commented Jan 8, 2026

Bundle Report

Changes will increase total bundle size by 432 bytes (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.86MB 432 bytes (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: antd.min-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antd-with-locales.min.js 216 bytes 2.12MB 0.01%
antd.min.js 216 bytes 1.74MB 0.01%

@thinkasany thinkasany merged commit 64f7963 into ant-design:feature Jan 8, 2026
37 of 38 checks passed
@guoyunhe guoyunhe deleted the feature-form-tel-validator branch January 8, 2026 08:53
@zombieJ zombieJ mentioned this pull request Jan 13, 2026
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants