Closed Bug 1032984 Opened 10 years ago Closed 9 years ago

Shift + Home does not highlight value instead appends autocomplete value

Categories

(DevTools :: Inspector, defect, P2)

30 Branch
x86_64
Windows 7
defect

Tracking

(firefox40 fixed)

RESOLVED FIXED
Firefox 40
Tracking Status
firefox40 --- fixed

People

(Reporter: tripad.mishra, Assigned: jfong)

References

(Blocks 1 open bug)

Details

(Whiteboard: [polish-backlog][difficulty=easy])

Attachments

(3 files, 1 obsolete file)

Attached image Pressing Shift and Home
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0 (Beta/Release)
Build ID: 20140605174243

Steps to reproduce:

Shift + Home key on any property does not select(highlight) the value, instead it appends the default value from auto complete.

(See the attached GIF)



Expected results:

This is pretty frustrating as instead of the expect behavior of highlighting the whole value, it appends the default value and now you need to select the whole value again to erase it.
Component: Untriaged → Developer Tools: Inspector
Can confirm on OSX with fn+arrow.  This appends the selected portion of the autocomplete onto the end of the input.  Happens with fn+left/fn+right/fn+up/fn+down
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [devedition-40]
Whiteboard: [devedition-40] → [devedition-40][difficulty=easy]
Jen, assigning to you as a potential polish bug.

Brian, since Jen is unfamiliar with this part of the codebase would you be available to mentor her here, or is someone else a better fit?
Assignee: nobody → jfong
Flags: needinfo?(bgrinstead)
Setting devedition-40 bugs to P2, filter on C17C996C-A0BE-4153-8057-FAB642D0746D
Priority: -- → P2
(In reply to J. Ryan Stinnett [:jryans] from comment #2)
> Brian, since Jen is unfamiliar with this part of the codebase would you be
> available to mentor her here, or is someone else a better fit?

Happy to, but I don't have much advice beyond the fact that you should start by looking at the _onKeyPress function in the inplace-editor file [0].  And, good luck!

[0]:  https://dxr.mozilla.org/mozilla-central/source/browser/devtools/shared/inplace-editor.js#856
Flags: needinfo?(bgrinstead)
Status: NEW → ASSIGNED
Yay! Finally this is being looked into :D

Just wanted to add that
*Shift + End* also has a similar issues.

And i have verified this on multiple versions of Ubuntu also.
(In reply to Brian Grinstead [:bgrins] from comment #4)
> (In reply to J. Ryan Stinnett [:jryans] from comment #2)
> > Brian, since Jen is unfamiliar with this part of the codebase would you be
> > available to mentor her here, or is someone else a better fit?
> 
> Happy to, but I don't have much advice beyond the fact that you should start
> by looking at the _onKeyPress function in the inplace-editor file [0].  And,
> good luck!
> 
> [0]: 
> https://dxr.mozilla.org/mozilla-central/source/browser/devtools/shared/
> inplace-editor.js#856

My best guess is that End/Home are somehow being treated similar to arrow keys and finishing the value within the editor, but also not changing the selection range for some reason.  In the case of home/end (with or without shift) we should just leave the event alone and not do any special things - the default behavior of the <input> should be fine.
Unassigning myself for now until next week (hopefully).
Assignee: jfong → nobody
Status: ASSIGNED → NEW
Assignee: nobody → jfong
Attached patch Bug1032984.patch (obsolete) — Splinter Review
This test is somewhat correct, but doesn't actually check the rule view - it checks any editable input (which works currently with the shift+home behavior on the inspector side, just not on the rule view side). Any idea how to specify the rule view property in this test?

Also let me know if the rest is more or less on the right track - thanks!
Attachment #8595038 - Flags: feedback?(bgrinstead)
Comment on attachment 8595038 [details] [diff] [review]
Bug1032984.patch

Review of attachment 8595038 [details] [diff] [review]:
-----------------------------------------------------------------

The fix seems good.  When trying to figure out exactly how to assert things in browser_inplace-editor, I realized that there is an easier test case to modify: styleinspector/test/browser_ruleview_completion-existing-property_01.js.

::: browser/devtools/shared/inplace-editor.js
@@ +881,5 @@
>      } else if (aEvent.altKey && !aEvent.shiftKey) {
>        increment *= smallIncrement;
>      }
>  
> +    // Default to highlighting text from the position of the cursor rather than

Nit: "Default to highlighting text from the position of the cursor" -> "Use default cursor movement"
Attachment #8595038 - Flags: feedback?(bgrinstead) → feedback+
Since I came up with this when trying to figure out what was going on, may as well share it
Status: NEW → ASSIGNED
Comment on attachment 8595038 [details] [diff] [review]
Bug1032984.patch

Review of attachment 8595038 [details] [diff] [review]:
-----------------------------------------------------------------

Also, on Mac fn+down and fn+up seem to cause the same problem.
(In reply to Brian Grinstead [:bgrins] from comment #12)
> Also, on Mac fn+down and fn+up seem to cause the same problem.

Which I believe maps to Page Up / Page Down
Comment on attachment 8595427 [details] [diff] [review]
Bug1032984.patch

Review of attachment 8595427 [details] [diff] [review]:
-----------------------------------------------------------------

Nice
Attachment #8595427 - Flags: review?(bgrinstead) → review+
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/ce1c811725e4
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [devedition-40][difficulty=easy] → [devedition-40][difficulty=easy][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/3ae82e9e39da
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [devedition-40][difficulty=easy][fixed-in-fx-team] → [devedition-40][difficulty=easy]
Target Milestone: --- → Firefox 40
See Also: → 1173604
Whiteboard: [devedition-40][difficulty=easy] → [polish-backlog][difficulty=easy]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: