Page MenuHomePhabricator

AceEditor in with RTL interface - text selection is broken
Closed, ResolvedPublic0 Estimated Story Points


AceEditor is broken for mix of RTL and LTR content. Since it is totally broken users in RTL wikis have to use external editor to edit content that appear in AceEditor.
In particular:

  1. JS/CSS/ Module (Lua) - pages with content type of js/cs/module have AceEditor by default [note: there is a fallback button to get regular textarea]
  2. Graph Insert Dialog [note: there is no fallback]

Steps to reproduce (in Firefox):

  1. Enter to some random page in RTL wiki (important - use RTL interface) and enter to VE edit:

  1. Insert=> Map - will open a map insert dialog
  2. Add a point on the map
  3. Try to change the coordinate in the aceeditor - note the text selection goes crazy


  1. I couldn't reproduce it in Chromium, but @Mikey641 reported a similar issue with AceEditor of Module NS
  2. It seems that the JSON is already defined as LTR, so I'm not sure what wrongs here

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

PS in general aceeditor sucks when you mix LTR and RTL (in both Chrome and Firefox). This is going to be a common scenario - as people will add Hebrew/Arabic titles for features.

So it would be nice to be able to toggle back to simple textarea instead of aceeditor similar to option in Lua/JS editing

Why has Kartographer been deployed to a Wikipedia?! Someone has jumped the gun here, there are three open blockers on T138057

I cannot reproduce following the provided steps in Firefox 49. Fixed?

he.wikipedia insert map.png (758×1 px, 161 KB)

@Nemo_bis in the above printscreen, place the cursor after the 573 and then press 9.
Expectation: ...5739...
Actual: 9 is will be somewhere else...

@Nemo_bis in the above printscreen, place the cursor after the 573 and then press 9.
Expectation: ...5739...
Actual: 9 is will be somewhere else...

Thanks for clarifying. I've tried, but works as expected for me.

  • This happen in Ubuntu, but I couldn't reproduce it on Android.
  • Validated with no browser plugins (firefox -safe-mode), as anonymous (no gadgets/scripts), and different settings of bidi.edit.caret_movement_style
eranroz renamed this task from AceEditor in Graph Insert Dialog with RTL interface - text selection is broken to AceEditor in with RTL interface - text selection is broken.Feb 5 2017, 9:28 PM
eranroz updated the task description. (Show Details)
eranroz added a subscriber: Mikey641.

@TheDJ thanks for the tip.

Seems that the issue is due to .ve-ui-mwAceEditorWidget .ace_editor css rule which assign font-family: monospace, "Courier"; - when removing the monospace (with Developer tools) the selection behaves OK and the issue is fixed. The issue doesn't appear in the upstream Ace (uses different font family)

Ebrahim added a subscriber: Ebrahim.

After all these years RTL editing issue of Ace is fixed when that is released as a stable version, the fix will be very beneficial for RTL wikis to have but there are still some issues with languages that don't have monospaced fonts for editing (e.g. Indic languages) which is also considered for fix but I guess that would also take some time.

(cross posting with T50826)

Testable with:

RTL content can be retrieved from:מדיה_ויקי:Common.js&action=edit

Still seems to have a few issues though.. at least for me on Mac with Safari and Chrome. But good to see that some progress is being made.

Please check if you set the editor font to "Courier New" will you get a better experience as I do here? Thanks.

Right, so it's 'better', unless you have a browser with glyph replacement, like Safari or Chrome on a Mac. (If I understand correctly, it will fallback to the first font with the glyph, even if that is not monotype)

eranroz assigned this task to Paladox.
eranroz added a subscriber: Paladox.

blaming @Paladox for fixing it here:
thanks :)

Change 380438 had a related patch set uploaded (by Ebrahim; owner: Ebrahim):
[mediawiki/extensions/CodeEditor@master] Update ace to 2017-09-20

Ebrahim removed Paladox as the assignee of this task.

@eranroz that is not syncing it to a version after 2017-07-02 but does.

Ebrahim assigned this task to Paladox.

I was wrong, I think date conversion misled me.

Change 380438 abandoned by Ebrahim:
Update ace to 2017-09-20

Not needed it seems.