Skip to content

Conversation

@aradhwan
Copy link

@aradhwan aradhwan commented Sep 11, 2025

Motivation

In RTL locales (e.g., Arabic), the dial code plus sign + can jump to the right side of the digits due to Unicode bidi reordering. Users expect + to remain on the left (e.g., +971).

What this PR changes

  • Adds a private _dialCodeLTR getter that wraps dialCode with U+200E (LRM).
  • Uses _dialCodeLTR in toString() and toLongString() so display strings render correctly in RTL.
  • Leaves the dialCode field untouched (search/filter behavior unchanged).

Rationale

LRM isolates the dial code as LTR, preventing bidi reordering in RTL UI while keeping API and data intact.

Screenshots

Before (LRM) After (LRM)
Before – dial code '+' appears on the right After – dial code '+' correctly on the left

Related issue

Fixes #67

Testing

  • Verified manually on Android & iOS with locale = ar.
  • Confirmed search/filter behavior unchanged (logic still uses raw dialCode).
  • Confirmed LTR locales unaffected.

Notes

  • Scope limited to directionality.

Wrap dial code with U+200E (LRM) in display strings to prevent bidi reordering in RTL.

Refs chandrabezzo#67
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.

RTL: Dial code “+” renders on the wrong side in Arabic (should stay on the left)

1 participant