Last modified: 2013-05-28 22:27:50 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T40546, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38546 - VisualEditor: Arrow keys move the caret in the opposite direction in RTL environment
VisualEditor: Arrow keys move the caret in the opposite direction in RTL envi...
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
ContentEditable (Other open bugs)
unspecified
All All
: High normal
: VE-deploy-2013-06-06
Assigned To: Moriel Schottlender
: i18n
Depends on:
Blocks: ve-rtl 48426
  Show dependency treegraph
 
Reported: 2012-07-21 11:04 UTC by Amir E. Aharoni
Modified: 2013-05-28 22:27 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Amir E. Aharoni 2012-07-21 11:04:23 UTC
Arrow keys move the caret in the opposite direction in RTL environment. Simple textareas in browsers do this correctly, so as much as possible, the Visual Editor should rely on the browsers' behavior.

See https://www.mediawiki.org/wiki/VisualEditor/Internationalization_requirements .

Related: bug 38000.
Comment 1 Christian Williams 2012-07-23 21:42:03 UTC
Amir, I'm pretty sure that this should be working properly in the new contenteditable-based editor. Can you double-check for me? Here's my RTL demo: http://framezero.com/work/wikia/VisualEditor/demos/ve/index.php
Comment 2 Amir E. Aharoni 2012-07-23 21:54:54 UTC
Try it with text that is actually RTL :)

Without looking at the code, I guess that you capture keypress events, and if it's a right arrow, you move it one character forward, and vice versa. But for RTL right is backward etc.

Simply reversing the direction for RTL text will not be enough, because an LTR word in the middle of an RTL paragraph will mess things up. And that's just one of the many complications. It took Gecko and Webkit developers years to get it right and both still have bugs.

The best way to handle arrow events is to simply let the browser handle them.
Comment 3 Inez Korczyński 2012-07-24 22:53:27 UTC
@Amir: Your guess it correct, we are capturing keyboard events (keydown to be specific) and then moving cursor forward (right arrow) or backward (left arrow). We implemented it in this way because it let's us block user from moving cursor inside a non-editable element (alien node - like rendered template for instance). It seems that we will have to work a little bit more on this, I will try to just let browser handle cursor movement but then "fix" it in JavaScript if it ends up in wrong place.
Comment 4 Gerrit Notification Bot 2013-05-27 22:19:48 UTC
Related URL: https://gerrit.wikimedia.org/r/65703 (Gerrit Change Ic01e110a5e6094cd275327a2e8cea90c900f1bd1)
Comment 5 James Forrester 2013-05-28 22:27:50 UTC
Merged and will go out in wmf6.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links