Using browser functions to switch input direction is impossible in the new wikitext editor
Closed, ResolvedPublic8 Story Points

Description

It's impossible to switch the element direction in the 2017 wikitext editor.

Usually the initial direction of a plain-text textarea is inherited or set by the dir attribute. Browsers allow users to switch this direction by a keyboard shortcut (Ctrl-Shift-X/Cmd-Shift-X in Firefox, Ctrl-Shift/Cmd-Shift in other browsers) or by a command in a context menu (something like right-click -> Switch text direction).

None of the above works in the 2017 wikitext editor, which is technically understandable, because it's not really a textarea, but a contenteditable with a monospaced font. From the user perspective, however, this is a major problem, because when editing wiki syntax, switching the direction is often needed for handling URLs, pieces of CSS, filenames, etc.

If I inspect the (more or less) root element of the editor, <div class="ve-ce-branchNode ve-ce-documentNode" contenteditable="true" dir="rtl">, and I change the value of dir to "ltr", then it does what is needed. But this is accessible only to very advanced users who can use the browsers' developer tools. If making Ctrl-Shift(-X) and the context menu direction switching is not possible, then having a toolbar button that switches the direction would be enough.

@eranroz can probably make a gadget for this in ten minutes ;) But this should be available to all users (at least in RTL wikis) and not as a gadget.

Amire80 created this task.Dec 15 2016, 8:32 PM
Restricted Application added projects: VisualEditor, I18n. · View Herald TranscriptDec 15 2016, 8:32 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Guycn2 added a subscriber: Guycn2.
Jdforrester-WMF changed the title from "Switching direction is impossible in the new wikitext editor" to "Using browser IME to switch input direction is impossible in the new wikitext editor".Jan 19 2017, 8:09 PM
Jdforrester-WMF triaged this task as "Normal" priority.
Jdforrester-WMF set the point value for this task to 8.
Jdforrester-WMF moved this task from To Triage to TR3: Language support on the VisualEditor board.

What does the user have to have installed for this shortcut to be enabled?

In Chrome I can change the writing direction from the context menu, but only one line at a time.

Amire80 changed the title from "Using browser IME to switch input direction is impossible in the new wikitext editor" to "Using browser functions to switch input direction is impossible in the new wikitext editor".Thu, Mar 16, 11:44 AM

Change 343040 had a related patch set uploaded (by Esanders):
[VisualEditor/VisualEditor] Add tool to change directionality of document view

https://gerrit.wikimedia.org/r/343040

Change 343069 had a related patch set uploaded (by Esanders):
[mediawiki/extensions/VisualEditor] [PULL THROUGH] Add tool to change directionality of document view

https://gerrit.wikimedia.org/r/343069

Change 343040 merged by jenkins-bot:
[VisualEditor/VisualEditor] Add tool to change directionality of document view

https://gerrit.wikimedia.org/r/343040

Jdforrester-WMF closed this task as "Resolved".Thu, Mar 16, 7:44 PM
Jdforrester-WMF assigned this task to Esanders.
Jdforrester-WMF edited projects, added User-notice; removed Patch-For-Review.
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptThu, Mar 16, 7:44 PM

Change 343069 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor] Update VE core submodule to master (ef5dc965f)

https://gerrit.wikimedia.org/r/343069

Tested in en.wikipedia.beta.wmflabs.org.

Works perfectly.

Thanks a lot!

Very happy to help. :-)