Closed
Bug 960695
Opened 11 years ago
Closed 11 years ago
Focus Input line when clicking anywhere in the console
Categories
(DevTools :: Console, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 29
People
(Reporter: rcampbell, Assigned: rcampbell)
References
Details
Attachments
(1 file, 2 obsolete files)
3.21 KB,
patch
|
rcampbell
:
review+
|
Details | Diff | Splinter Review |
Shouldn't have to click inside the textbox to focus the console
Attachment #8361260 -
Flags: feedback?(mihai.sucan)
Comment 1•11 years ago
|
||
Comment on attachment 8361260 [details] [diff] [review]
focus
LGTM. Please check the event target, so it doesn't change the focus when you click on anchors. Thanks!
Attachment #8361260 -
Flags: feedback?(mihai.sucan) → feedback+
Assignee | ||
Comment 2•11 years ago
|
||
(In reply to Mihai Sucan [:msucan] from comment #1)
> Comment on attachment 8361260 [details] [diff] [review]
> focus
>
> LGTM. Please check the event target, so it doesn't change the focus when you
> click on anchors. Thanks!
good idea. Thank you!
Assignee: nobody → rcampbell
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•11 years ago
|
||
Added the check for anchors. Not 100% happy with it but probably good enough. The first check for links appears to only really matter for network requests which open the network popup. I'd consider removing that check altogether and focusing the input line there too, but ...
Also added a test.
Attachment #8361260 -
Attachment is obsolete: true
Attachment #8362543 -
Flags: review?(mihai.sucan)
Assignee | ||
Comment 4•11 years ago
|
||
what did my editor do to the indenting in that test file? I don't even...
Comment 5•11 years ago
|
||
Comment on attachment 8362543 [details] [diff] [review]
focus
Review of attachment 8362543 [details] [diff] [review]:
-----------------------------------------------------------------
Patch looks good. r+ with the following fixes:
Got an exception playing around:
System JS : ERROR resource://gre/modules/commonjs/toolkit/loader.js -> file:///home/mihai/src/mozilla/fx-team/browser/devtools//webconsole/webconsole.js:578 - TypeError: e.target.tagName is undefined
tagName is not available for all node types.
Also please fix indentation. :) Thank you!
::: browser/devtools/webconsole/test/browser_console_click_focus.js
@@ +14,5 @@
> +
> +function testInputFocus() {
> + browser.removeEventListener("DOMContentLoaded", testInputFocus, false);
> +
> + openConsole(null, function(hud) {
nit: openConsole().then(...)
(callback is "deprecated")
::: browser/devtools/webconsole/webconsole.js
@@ +574,5 @@
> + * Only focus when the target node (or parent, as in source links) is
> + * not an anchor.
> + */
> + this.outputNode.addEventListener("click", (e) => {
> + if ((e.target.tagName.toLowerCase() != "a") &&
Does it focus the input on any button click? Maybe you should check that e.button == 0 (left mouse button).
Attachment #8362543 -
Flags: review?(mihai.sucan) → review+
Assignee | ||
Comment 6•11 years ago
|
||
fixed up. Thanks for the review!
Attachment #8362543 -
Attachment is obsolete: true
Attachment #8363180 -
Flags: review+
Attachment #8363180 -
Flags: checkin?
Assignee | ||
Updated•11 years ago
|
Whiteboard: [land-in-fx-team]
Assignee | ||
Comment 7•11 years ago
|
||
Flags: in-testsuite+
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
Comment 8•11 years ago
|
||
Comment on attachment 8363180 [details] [diff] [review]
focus
Please just use checkin-needed :)
Attachment #8363180 -
Flags: checkin?
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 29
Comment 10•11 years ago
|
||
Filed bug 964268 because single line text selection was not working anymore.
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•