Skip to content

fix(common): allow DateInput to accept a dot separator - #906

Open
adarshswaminath wants to merge 1 commit into
coinbase:masterfrom
adarshswaminath:fix/date-input-dot-separator
Open

adarshswaminath wants to merge 1 commit into
coinbase:masterfrom
adarshswaminath:fix/date-input-dot-separator

Conversation

@adarshswaminath

@adarshswaminath adarshswaminath commented Oct 9, 2026 •

Copy link
Copy Markdown

What changed? Why?

DateInput with separator="." dropped normal keystrokes. Typing 08 was treated as a doubled separator, so the field could not become 08.18.2024.

The dot is now escaped in the duplicate-separator check. 08..18 is still blocked. / and - are unchanged. Web and mobile DateInput both use this shared code

Fixes #905

Root cause (required for bugfixes)

IntlDateFormat built the check with new RegExp(${separator}{2,}). In a regular expression, . means "any character," so any two characters looked like ...

UI changes

No layout or style change. The only difference is that a dotted date can be typed.

iOS Old iOS New
n/a n/a
Android Old Android New
n/a n/a
Web Old Web New
With separator=".", a second digit is ignored Typing 08182024 shows 08.18.2024

Testing

How has it been tested?

  • Unit tests
  • Interaction tests
  • Pseudo State tests
  • Manual - Web
  • Manual - Android (Emulator / Device)
  • Manual - iOS (Emulator / Device)

Testing instructions

Unit test:

yarn nx run common:test --testPathPattern=src/dates/__tests__/IntlDateFormat.test.ts

Storybook:

  1. Run yarn nx run storybook:dev and open Components → Dates → DateInput.
  2. Set one DateInput to separator=".".
  3. Clear the field and type 08182024.
  4. The field should show 08.18.2024. A doubled dot such as 08..18 should still be rejected.

Illustrations/Icons Checklist

Required if this PR changes files under packages/illustrations/** or packages/icons/**

Not applicable.

  • verified visreg changes with Terran (include link to visreg run/approval)
  • all illustration/icons names have been reviewed by Dom and/or Terran

Change management

type=routine
risk=low
impact=sev5

automerge=false

@cb-heimdall

Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 1
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1
CODEOWNERS 🟡 See below

🟡 CODEOWNERS

Code Owner Status Calculation
ui-systems-eng-team 🟡 0/1
Denominator calculation
Additional CODEOWNERS Requirement
Show calculation
Sum 0
0
From CODEOWNERS 1
Sum 1

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Bug: DateInput drops keystrokes when using "." as the separator

2 participants