Skip to content

RTL (right-to-left) text is mis-ordered in message bubbles and the input field #3047

@kfatehi

Description

@kfatehi

Description

Right-to-left languages (Persian/Farsi, Arabic, Hebrew) don't render correctly:

  • In message bubbles, trailing punctuation and emoji appear on the wrong (right)
    side instead of the left, and text isn't right-aligned within the bubble.
  • In the compose and subject fields, alignment/caret stays left-to-right while
    typing RTL.
  • Conversation-list titles and last-message previews have the same mis-ordering.

Root cause: the message RichText/Text widgets and the input TextFields render
with the app's ambient (LTR) paragraph direction instead of one derived from the
text content.

Steps to reproduce

  1. Send or receive a message in Farsi/Arabic/Hebrew that ends with punctuation
    or an emoji (e.g. سلام 😀).
  2. The emoji/punctuation appears on the right and the text is left-aligned;
    correct RTL rendering would put the trailing emoji on the left with the text
    right-aligned.
  3. Type RTL text in the compose field — input stays LTR.

Context

Reported on the OpenBubbles fork as OpenBubbles#174 (unfixed there).

A working fix — per-widget textDirection derived from the first strong
character of the text, computed over runes so emoji-leading RTL is detected
correctly — is in this commit:
b92461f

Filing here because BlueBubbles has no existing RTL issue.

In this branch, containing that commit, it looks correct like so:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions