Skip to content

feat(NumberInput): updated locale format validation arabic japanese#21135

Merged
heloiselui merged 10 commits into
carbon-design-system:mainfrom
abpaul1993:fix-numberInput-type-text-locale-format-issue-in-arabic-japanese
Jan 13, 2026
Merged

feat(NumberInput): updated locale format validation arabic japanese#21135
heloiselui merged 10 commits into
carbon-design-system:mainfrom
abpaul1993:fix-numberInput-type-text-locale-format-issue-in-arabic-japanese

Conversation

@abpaul1993

@abpaul1993 abpaul1993 commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Closes #

This PR enhances our number parsing and validation logic to support all major Unicode numeral systems recognized by Intl.NumberFormat in validateNumberSeparators method along with the valid decimal and group seperator.
Previously, only Western digits were handled in the method.
With this update, the number input component now correctly accepts, validates, and normalizes numerals from multiple writing systems—matching real-world locale behavior across international users.

Changelog

New

  1. Enhanced number parsing and validation to support all major Unicode numeral systems recognized by Intl.NumberFormat.
  2. The validateNumberSeparators method now supports locale-specific decimal and grouping separators along with non-Western numerals.

Changed

  • validateNumberSeparators, which was previously available for custom validation, has been updated to support Arabic and other Unicode numeral systems.
  • Number input validation now normalizes and validates numerals from multiple writing systems instead of only Western digits.

Removed

  • {{removed thing}}

Testing / Reviewing

  • Verify that number inputs accept numerals from different Unicode numeral systems (e.g., Arabic-Indic, Devanagari).
  • Confirm that locale-specific decimal and grouping separators are correctly validated.
  • Ensure existing Western digit inputs continue to work as expected.
  • Validate that custom validations using validateNumberSeparators behave correctly across locales.

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and storybook examples
  • Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

@abpaul1993 abpaul1993 requested a review from a team as a code owner December 5, 2025 15:14
@netlify

netlify Bot commented Dec 5, 2025

Copy link
Copy Markdown

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 4354875
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/696621dbc1876e00089ae7d5
😎 Deploy Preview https://deploy-preview-21135--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Dec 5, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.56522% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.16%. Comparing base (75ae1b9) to head (4354875).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...s/react/src/components/NumberInput/NumberInput.tsx 94.56% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21135      +/-   ##
==========================================
+ Coverage   86.15%   86.16%   +0.01%     
==========================================
  Files         535      535              
  Lines       41826    41893      +67     
  Branches     6460     6462       +2     
==========================================
+ Hits        36035    36099      +64     
- Misses       5627     5631       +4     
+ Partials      164      163       -1     
Flag Coverage Δ
main-packages 85.91% <94.56%> (+0.04%) ⬆️
web-components 86.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@netlify

netlify Bot commented Dec 5, 2025

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 4354875
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/696621db28abf60008c18010
😎 Deploy Preview https://deploy-preview-21135--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Dec 5, 2025

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit 4354875
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/696621dbd6fcd900084f2d27
😎 Deploy Preview https://deploy-preview-21135--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kennylam

Copy link
Copy Markdown
Member

@abpaul1993 Please update the Changelog, Testing/Reviewing, and PR Checklist in the PR description. Thanks!

@alisonjoseph alisonjoseph removed the request for review from tay1orjones December 12, 2025 20:01
@abpaul1993

abpaul1993 commented Dec 14, 2025

Copy link
Copy Markdown
Contributor Author

@kennylam I have updated the PR details based on the feedback.

@heloiselui heloiselui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi, thanks for your PR, I’ve left a few comments.

Comment thread packages/react/src/components/NumberInput/NumberInput.tsx Outdated
Comment thread packages/react/src/components/NumberInput/NumberInput.tsx
Comment thread packages/react/src/components/NumberInput/__tests__/NumberInput-test.js Outdated
@abpaul1993

Copy link
Copy Markdown
Contributor Author

hi @heloiselui I have updated my code base as per your comments, please re review once.

Comment thread packages/react/src/components/NumberInput/NumberInput.tsx Outdated
@heloiselui heloiselui added this pull request to the merge queue Jan 13, 2026
Merged via the queue into carbon-design-system:main with commit 72d196f Jan 13, 2026
42 of 43 checks passed
@carbon-automation

Copy link
Copy Markdown
Contributor

Hey there! v11.99.0 was just released that references this issue/PR.

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.

4 participants