Skip to content

feat: pagination go input accept number only#55700

Merged
afc163 merged 3 commits intonextfrom
feat/pagination-jumper-numberic
Nov 14, 2025
Merged

feat: pagination go input accept number only#55700
afc163 merged 3 commits intonextfrom
feat/pagination-jumper-numberic

Conversation

@afc163
Copy link
Member

@afc163 afc163 commented Nov 13, 2025

中文版模板 / 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

close #55637

💡 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 Pagination quick jumper now accept numberic value only.
🇨🇳 Chinese Pagination 快速跳转输入框现在限制只能输入数字。

@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 Nov 13, 2025

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.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/pagination-jumper-numberic

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.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2025

👁 Visual Regression Report for PR #55700 Failed ❌

🎯 Target branch: next (fd41654)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🔄 1 changed

Expected (Branch next) Actual (Current PR) Diff
select-debug-flip-shift.default.png select-debug-flip-shift.default.png select-debug-flip-shift.default.png select-debug-flip-shift.default.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 Nov 13, 2025

Preview is ready

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @afc163, 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 an enhancement to the pagination component by updating its underlying dependency. The primary impact of this update is the implementation of stricter input validation for the quick jumper functionality, ensuring that users can only enter numerical values. This change aims to improve the robustness and user experience of the pagination component by preventing invalid input.

Highlights

  • Dependency Update: The @rc-component/pagination dependency has been updated from version ~1.1.4 to ~1.2.0.
  • Pagination Quick Jumper Input Validation: The pagination quick jumper input field now strictly accepts only numeric values, preventing non-numeric input.
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.

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 updates the @rc-component/pagination dependency to version ~1.2.0 to restrict the quick jumper input to numeric values only. The dependency update is correct. However, this change should be accompanied by a test case to verify the new behavior and prevent future regressions. I have left a comment on the package.json change with a suggestion for a test. Additionally, there is a small typo in the English changelog in the PR description: 'numberic' should be 'numeric'.

"@rc-component/mutate-observer": "^2.0.0",
"@rc-component/notification": "~1.2.0",
"@rc-component/pagination": "~1.1.4",
"@rc-component/pagination": "~1.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While updating the dependency is correct, this change should be accompanied by a new test case in components/pagination/__tests__/index.test.tsx to verify that the quick jumper input now only accepts numeric values. This will prevent regressions if the dependency is changed in the future or if the behavior of the dependency changes unexpectedly.

Here is an example of what the test could look like:

it('quick jumper input should only accept numbers', () => {
  const onChange = jest.fn();
  const { container } = render(
    <Pagination defaultCurrent={1} total={500} showQuickJumper onChange={onChange} />,
  );
  const input = container.querySelector(
    '.ant-pagination-options-quick-jumper input',
  ) as HTMLInputElement;

  // Test submitting a valid page number
  fireEvent.change(input, { target: { value: '20' } });
  fireEvent.keyDown(input, { key: 'Enter', code: 'Enter' });
  expect(onChange).toHaveBeenCalledWith(20, 10);
  expect(onChange).toHaveBeenCalledTimes(1);

  // Test submitting a non-numeric value
  fireEvent.change(input, { target: { value: 'abc' } });
  fireEvent.keyDown(input, { key: 'Enter', code: 'Enter' });
  // onChange should not be called again
  expect(onChange).toHaveBeenCalledTimes(1);
});

@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2025

size-limit report 📦

Path Size
dist/antd.min.js 497.02 KB (+21 B 🔺)
dist/antd-with-locales.min.js 589.12 KB (+25 B 🔺)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 13, 2025

@codecov
Copy link

codecov bot commented Nov 13, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
antd.min-array-push 3.77MB 42 bytes (0.0%) ⬆️

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 21 bytes 2.08MB 0.0%
antd.min.js 21 bytes 1.69MB 0.0%

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 13, 2025

Deploying ant-design-next with  Cloudflare Pages  Cloudflare Pages

Latest commit: 13ffe14
Status: ✅  Deploy successful!
Preview URL: https://0c581cc5.ant-design-next.pages.dev
Branch Preview URL: https://feat-pagination-jumper-numbe.ant-design-next.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 13, 2025

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: 13ffe14
Status: ✅  Deploy successful!
Preview URL: https://32f61520.ant-design.pages.dev
Branch Preview URL: https://feat-pagination-jumper-numbe.ant-design.pages.dev

View logs

@socket-security
Copy link

socket-security bot commented Nov 13, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedfast-glob@​3.3.39910010079100
Updated@​rc-component/​pagination@​1.1.4 ⏵ 1.2.079 -510097 -195 +2100
Addedchalk@​5.6.210010010081100
Addedlodash@​4.17.211001008781100
Addedimmer@​10.2.01001008387100
Addedtypescript@​5.9.31001009010090

View full report

@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (fd41654) to head (13ffe14).
⚠️ Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff            @@
##              next    #55700   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          800       800           
  Lines        14770     14770           
  Branches      3910      3910           
=========================================
  Hits         14770     14770           

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

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 13, 2025
@socket-security
Copy link

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Protestware or unwanted behavior: npm es5-ext

Note: This package prints a protestware console message on install regarding Ukraine for users with Russian language locale

From: ?npm/es5-ext@0.10.64

ℹ Read more on: This package | This alert | What is protestware?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Consider that consuming this package may come along with functionality unrelated to its primary purpose.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/es5-ext@0.10.64. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Protestware or unwanted behavior: npm es5-ext

Note: The script attempts to run a local post-install script, which could potentially contain malicious code. The error handling suggests that it is designed to fail silently, which is a common tactic in malicious scripts.

From: ?npm/es5-ext@0.10.64

ℹ Read more on: This package | This alert | What is protestware?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Consider that consuming this package may come along with functionality unrelated to its primary purpose.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/es5-ext@0.10.64. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@afc163 afc163 merged commit 0c6cd49 into next Nov 14, 2025
43 of 44 checks passed
@afc163 afc163 deleted the feat/pagination-jumper-numberic branch November 14, 2025 05:56
@zombieJ zombieJ mentioned this pull request Nov 19, 2025
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.

3 participants