Closed
Bug 935807
Opened 11 years ago
Closed 11 years ago
D-pad arrow keys move focus outside textarea instead of navigating within
Categories
(Firefox for Android Graveyard :: Keyboards and IME, defect)
Tracking
(firefox26 unaffected, firefox27+ fixed, firefox28+ fixed, firefox29 verified, fennec27+)
VERIFIED
FIXED
Firefox 28
People
(Reporter: kats, Assigned: mcomella)
References
Details
(Keywords: regression)
Attachments
(1 file, 2 obsolete files)
1.94 KB,
patch
|
bnicholson
:
review+
bajaj
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Using a device with a physical keyboard (Galaxy Q for instance) that has a d-pad:
1. Go to a page with a multiline textarea (such as a bugzilla comment field)
2. Enter a multiline comment
3. Attempt to navigate the lines using the up and down arrows on the d-pad
Expected:
You can move up and down a line using the up and down keys
Actual:
The focus jumps out of the textarea to surrounding elements.
This makes editing multiline textareas quite frustrating. It is a regression, I assume from Mina's patch that added d-pad focus navigation.
Reporter | ||
Updated•11 years ago
|
Comment 1•11 years ago
|
||
Yep that's me. The way to fix that I think is to restore the lines here:
https://bugzilla.mozilla.org/attachment.cgi?id=546796&action=diff
in file SpatialNavigation.js line 136.
That would be a quick fix and restore the previous behavior. A more thorough fix would make it so that prssing the action key with a text input element highlighted enters text editing mode, and subsequent d-pad key presses with navigate inside the text element. Then maybe pressing the esc key or the back key in the ouya would exit text editing mode, and you're back to jumping from element to element on the page.
Updated•11 years ago
|
Assignee: nobody → michael.l.comella
tracking-fennec: ? → 27+
Updated•11 years ago
|
Status: NEW → ASSIGNED
Comment 2•11 years ago
|
||
http://hg.mozilla.org/mozilla-central/pushloghtml?startdate=2013-10-13&enddate=2013-10-14
972d7d7be035 Mina Almasry — Bug 698437 - Allow spatial navigation with directional controller. r=kats
Updated•11 years ago
|
status-firefox26:
--- → unaffected
status-firefox27:
--- → affected
status-firefox28:
--- → affected
Comment 4•11 years ago
|
||
Hardware Keyboard need not be required.
This is reproducible with Hacker's Keyboard in landscape (they expose cursor controls).
User Report: https://support.mozilla.org/en-US/questions/977904
Hacker's Keyboard: https://play.google.com/store/apps/details?id=org.pocketworkstation.pckeyboard&hl=en
Assignee | ||
Comment 5•11 years ago
|
||
I restored the original behavior as mentioned in comment 1. Additionally, I
left the functionality Mina added where selecting a new input element will
select all of the text inside since 1) I feel it makes sense and 2) I don't
have a gamepad to test what the effects of this change would be on it (which
I believe is the original reason this file was re-added).
Tested on TouchPal (it has issues - see bug 943042), Hacker's Keyboard, and a
hardware keyboard.
Attachment #8338000 -
Flags: review?(almasry.mina)
Assignee | ||
Updated•11 years ago
|
Attachment #8338000 -
Flags: review?(almasry.mina) → review?(bnicholson)
Assignee | ||
Comment 6•11 years ago
|
||
Changing reviewer tag.
Attachment #8338018 -
Flags: review?(bnicholson)
Assignee | ||
Updated•11 years ago
|
Attachment #8338000 -
Attachment is obsolete: true
Attachment #8338000 -
Flags: review?(bnicholson)
Comment 7•11 years ago
|
||
I'm available for review if no one else would do it btw :-)
Comment 8•11 years ago
|
||
Comment on attachment 8338018 [details] [diff] [review]
Restore arrow key input field navigation behavior.
Review of attachment 8338018 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/modules/SpatialNavigation.jsm
@@ +126,5 @@
> }
>
> + if ((currentlyFocused instanceof Ci.nsIDOMHTMLInputElement &&
> + currentlyFocused.mozIsTextField(false)) ||
> + currentlyFocused instanceof Ci.nsIDOMHTMLTextAreaElement) {
Nit: tab indentation
@@ +128,5 @@
> + if ((currentlyFocused instanceof Ci.nsIDOMHTMLInputElement &&
> + currentlyFocused.mozIsTextField(false)) ||
> + currentlyFocused instanceof Ci.nsIDOMHTMLTextAreaElement) {
> + // If there is a text selection, remain in the element.
> + if (currentlyFocused.selectionEnd - currentlyFocused.selectionStart > 0) {
Is this safe for right-to-left selections and RTL users? Could we just use | selectionStart != selectionEnd |?
@@ +134,5 @@
> + }
> +
> + // If there is no text, there is nothing special to do.
> + if (currentlyFocused.textLength > 0) {
> + if (key == PrefObserver['keyCodeRight'] ||
Is this RTL-safe?
@@ +140,5 @@
> + // We are moving forward into the document.
> + if (currentlyFocused.textLength != currentlyFocused.selectionEnd) {
> + return;
> + }
> + } else {
Nit: } else if (...) {
Updated•11 years ago
|
tracking-firefox27:
--- → ?
tracking-firefox28:
--- → ?
Updated•11 years ago
|
Assignee | ||
Comment 9•11 years ago
|
||
Fixed the nits.
(In reply to Brian Nicholson (:bnicholson) from comment #8)
> Is this safe for right-to-left selections and RTL users? Could we just use |
> selectionStart != selectionEnd |?
Done.
> @@ +134,5 @@
> > + }
> > +
> > + // If there is no text, there is nothing special to do.
> > + if (currentlyFocused.textLength > 0) {
> > + if (key == PrefObserver['keyCodeRight'] ||
>
> Is this RTL-safe?
Probably not but the precedent exists elsewhere in the code. I think the most
appropriate action would be to file a follow-up since this affects 27.
Note also that RTL text selection seems to be entirely broken (tested on 25 and
28 on Arabic - see https://people.mozilla.org/~mcomella/test/textarea.html).
Attachment #8342712 -
Flags: review?(bnicholson)
Assignee | ||
Updated•11 years ago
|
Attachment #8338018 -
Attachment is obsolete: true
Attachment #8338018 -
Flags: review?(bnicholson)
Updated•11 years ago
|
Attachment #8342712 -
Flags: review?(bnicholson) → review+
Updated•11 years ago
|
Keywords: checkin-needed
Comment 10•11 years ago
|
||
Keywords: checkin-needed
Assignee | ||
Comment 11•11 years ago
|
||
> I think the most appropriate action would be to file a follow-up since this affects 27.
bug 946886.
Comment 12•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 28
Assignee | ||
Comment 13•11 years ago
|
||
Comment on attachment 8342712 [details] [diff] [review]
Restore arrow key input field navigation behavior.
[Approval Request Comment]
Bug caused by (feature/regressing bug #):
Bug 698437
User impact if declined:
Users cannot navigate between text fields with the arrow keys
Testing completed (on m-c, etc.):
Local testing with TouchPal/Hacker's Keyboard/hardware keyboard, merged to m-c today.
Risk to taking this patch (and alternatives if risky):
Low to medium. This affects the _onInputKeyPress method that gets called when a key is pressed so in the worst case, all keyboard input may break. However, the existing method code only allows us to observe keystrokes for the arrow keys and return. The added code specifically only looks for at those keystrokes when a text field is focused, and will only escape back to the behavior that occurred before the regressing bug was implemented (via extra "return;" statements) so the possibility for major error is minimal.
String or IDL/UUID changes made by this patch:
None
Attachment #8342712 -
Flags: approval-mozilla-aurora?
Comment 14•11 years ago
|
||
Comment on attachment 8342712 [details] [diff] [review]
Restore arrow key input field navigation behavior.
Approving this change ahead of the merge. Requesting QA verification on nightly/aurora as soon as they can, so we can identify any fallouts. If something major is broken, we should immediately back this out.
Attachment #8342712 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•11 years ago
|
Flags: needinfo?(aaron.train)
Assignee | ||
Comment 15•11 years ago
|
||
Updated•11 years ago
|
Updated•11 years ago
|
Status: RESOLVED → VERIFIED
status-firefox29:
--- → verified
Flags: needinfo?(aaron.train)
Keywords: verifyme
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•