Open Bug 1198600 Opened 7 years ago Updated 3 years ago

The behaviour of the arrow keys in right-to-left languages is confusing


(Core :: DOM: UI Events & Focus Handling, defect)

40 Branch
Not set





(Reporter: erelsgl, Unassigned)


User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0
Build ID: 20150807094952

Steps to reproduce:

* Open any web-page with an input field or a text-area.
* Enter some Hebrew words, e.g. "אאא בבב גגג דדד"
* Put the cursor in the middle of the text.
* Click the right-arrow, then Ctrl+right-arrow, then Shift+right-arrow, then Ctrl+Shift+right-arrow.

Actual results:

* Click the right-arrow: the cursor moves one char to the right (that is OK).
* Click Ctrl+right-arrow: the cursor moves one word to the right (that is OK).
* Click Shift+right-arrow: the cursor marks one char to the right (that is OK).
* Click Ctrl+Shift+right-arrow: the cursor marks one word to the LEFT (that is not OK).

Expected results:

When Clicking Ctrl+Shift+right-arrow, the cursor should marks one word to the RIGHT.
Component: Untriaged → Keyboard Navigation
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
ehsan, do you know who the right person is to own this?
Flags: needinfo?(ehsan)
Hmm, usually Simon, but I am not sure if we have anyone these days...  I guess I can take a look at some point.
This seems to be quite a can of worms, and we seem to have different behaviors in different platforms.  But the first issue is the bidi.edit.caret_movement_style pref.  Its default value is 2, which means use visual selection except if we are selecting, which seems quite insane to me.  The reasoning seems to go back to bug 330175 comment 1, but Safari right now uses visual selection always, and I think we should do that too.

roc, what do you think?
Component: Keyboard Navigation → Keyboard: Navigation
Flags: needinfo?(roc)
Product: Firefox → Core
Over to Jonathan.
Flags: needinfo?(roc) → needinfo?(jfkthame)
Masayuki is going to work on editor related stuff...  Moving the needinfo.
Flags: needinfo?(ehsan) → needinfo?(masayuki)
Hmm, I'm not sure what's the best behavior in bidi text. Basically, we should use same behavior as the standard behavior on each platform. So, according to comment 3, at least on Mac, we should change the default pref value to 1.
Flags: needinfo?(masayuki)
I think we should use visual selection always, on all platforms.  Logical selection makes no sense to users.  We already navigate the caret in visual mode, and given that, having selection happen in logical mode is extremely confusing.
Component: Keyboard: Navigation → User events and focus handling
You need to log in before you can comment on or make changes to this bug.