Case ce-0179-arabic-ime-character-joining-safari · Scenario scenario-ime-rtl-and-character-joining

Arabic IME character joining and RTL direction issues in Safari

OS: macOS 14.0 Device: Desktop or Laptop Any Browser: Safari 17.0 Keyboard: Arabic (IME) Status: draft
ime composition arabic rtl text-direction character-joining safari macos

Phenomenon

When composing Arabic text with IME in a contenteditable element in Safari on macOS, Arabic letters may not join correctly based on their context, appearing as separate disconnected characters instead of forming connected words. RTL (right-to-left) text direction may also not be handled correctly, and caret movement may be incorrect in RTL context.

Reproduction example

  1. Create a contenteditable div.
  2. Set direction to RTL or use auto direction.
  3. Switch to Arabic IME.
  4. Type Arabic text (e.g., “مرحبا”).
  5. Observe character joining and text direction.

Observed behavior

  • Arabic letters may not join correctly, appearing disconnected
  • Text may display left-to-right instead of right-to-left
  • Caret may move incorrectly in RTL text
  • Text selection may not work correctly in RTL context
  • Mixed Arabic and Latin text may have incorrect direction handling

Expected behavior

  • Arabic letters should join contextually based on their position
  • Text should display right-to-left correctly
  • Caret should move correctly in RTL context
  • Text selection should work correctly in RTL
  • Mixed-direction text should handle direction correctly

Impact

  • Arabic text may be unreadable or difficult to read
  • Users cannot reliably input correct Arabic text
  • Mixed-direction text (Arabic + English) may display incorrectly

Browser Comparison

  • Safari: RTL and character joining can be inconsistent, especially on macOS
  • Chrome: Generally better RTL support, but character joining can still fail
  • Firefox: RTL support is good, but some edge cases exist

Notes and possible direction for workarounds

  • Ensure proper RTL direction is set (dir=“rtl”)
  • Monitor for Arabic text and set direction automatically
  • Validate character joining after composition
  • Handle mixed-direction text carefully
  • Use Unicode bidirectional algorithm (bidi) for complex cases
  • Check text direction with getComputedStyle
Before
Hello مرح
Arabic composition in progress (مرح), RTL direction
After (Bug)
Hello م ر ح
Character joining failed, separated into individual characters
vs
✅ Expected
Hello مرحبا
Expected: Characters correctly joined (مرحبا)

Browser compatibility matrix

This matrix shows which browser and OS combinations have documented cases for this scenario. The current case is highlighted. Click on a cell to view other cases.

Current case
Confirmed
Draft
No case documented

All variants (detailed table)

Complete list of all cases for this scenario with full environment details.

Case OS Device Browser Keyboard Status
ce-0179-arabic-ime-character-joining-safari macOS 14.0 Desktop or Laptop Any Safari 17.0 Arabic (IME) draft
ce-0207-hebrew-ime-rtl-composition-firefox Windows 11 Desktop or Laptop Any Firefox 120.0 Hebrew (IME) draft

Playground for this case

Use the reported environment as a reference and record what happens in your environment while interacting with the editable area.

Reported environment
OS: macOS 14.0
Device: Desktop or Laptop Any
Browser: Safari 17.0
Keyboard: Arabic (IME)
Your environment
Sample HTML:
Event log
Use this log together with the case description when filing or updating an issue.
0 events
Interact with the editable area to see events here.

Comments & Discussion

Have questions, suggestions, or want to share your experience? Join the discussion below.