Dir="auto" for composer and elsewhere

Continuing the discussion from What does the support mixed text direction setting do?:

Should we deprecate this setting, composer button and add dir="auto" by default in our text areas? IE is not a blocker anymore.

2 Likes

This setting also affects non-textarea things. e.g. it is used to apply dir= to paragraphs/quotes in posts:

And topic titles:

and more.

Can we use dir="auto" for all these things now? :crossed_fingers:

1 Like

Makes sense, users need this everywhere they input text:

  • Composer textarea
  • Composer preview
  • Topic titles in topics
  • Topic titles in lists
  • Posts in topics
  • Bio in usercard / profile
  • Topic “previews” in topics lists
2 Likes

I took a stab at updating our support_mixed_text_direction setting to lean on dir="auto" instead of using a regex to parse all user input at render-time:

I think we’ll need to keep this. Setting dir="auto" on a textarea will use a heuristic to decide the direction of the entire textarea. That doesn’t sound too useful if you’re writing a post which contains a combination of rtl and ltr languages. So I think the button is required for you to switch back & forth while editing?

In cooked posts, the dir="auto" can be applied per-paragraph, which solves that problem.

Would be great if some readers / writers of RTL languages can weigh in on that, and perhaps take a look at the PR. (cc @osama - git suggests you have done a lot of work on our RTL logic)

4 Likes

Yes, exactly, the button is very useful when you’re typing a post that mixes RTL and LTR languages.

Your PR LGTM @david :rocket:

3 Likes

This is now merged. Please let us know if you have any feedback

2 Likes

This topic was automatically closed after 171 days. New replies are no longer allowed.