Bugzilla search / query should focus summary field

RESOLVED FIXED in Bugzilla 2.18



Query/Bug List
16 years ago
5 years ago


(Reporter: Tim Powell, Assigned: Christian Reis)


Bugzilla 2.18
Bug Flags:
approval +



(1 attachment, 2 obsolete attachments)



16 years ago
When you go to the search form, no field has focus. The summary field should
have focus by default, so you can immediately start typing, just like on the
index page with quicksearch and most search engines.

This is easily accomplished with a line of javascript:

<script language="JavaScript">
// -->

One place to add this is on line 30 of
 onload = "selectProduct(document.forms['queryform']);"
 onload = "selectProduct(document.forms['queryform']);

Although this is a minor change, it will save time for all users.


16 years ago
Target Milestone: --- → Bugzilla 2.18
Assignee: endico → nobody

Comment 1

14 years ago
These bugs appear to be abandoned.  Retargeting to 2.20
Target Milestone: Bugzilla 2.18 → Bugzilla 2.20

Comment 2

14 years ago
Trivial. Patch coming up.
Assignee: nobody → kiko
Target Milestone: Bugzilla 2.20 → Bugzilla 2.18

Comment 3

14 years ago
Created attachment 144226 [details] [diff] [review]
kiko_v1: add focus() call to onLoad handler. 

Tested and works. Shouldn't be any cross-browser issues -- it's the same DOM
access we use for the form selection JS.


14 years ago
Attachment #144226 - Flags: review?(myk)
This is not necessarily a good thing, for the following reason: if a page takes
a couple of seconds to load (as our query page does, being very big), and you've
already clicked somewhere and started typing, the focus gets stolen from you,
which is really irritating. Can we detect whether that has happened before
calling focus()?

(For something like www.google.com, which is tiny, it's fine.)

Comment on attachment 144226 [details] [diff] [review]
kiko_v1: add focus() call to onLoad handler. 

Gerv has a point; this is even painful on Google sometimes.  Can we do this
right after displaying the summary field rather than after the page has been
Attachment #144226 - Flags: review?(myk)
With the advent of the new fulltext search, I'm usually using that when I need
to do a "quick" query on something easy.  When I go to the Advanced Query page,
I typically want to do something advanced, and most of the time it's somewhere
below the top screen of the page.  First thing I generally do when the query
page loads is hit the space bar to page down.  That gets broken if the summary
field focuses.

That said, I'd be all for focusing the "enter some words" field on the fulltext
search page, since the entire page (mostly) fits in the browser window, and the
fulltext search will be the default search page when 2.18 ships.

Comment 7

14 years ago
So what do I do now?
Severity: minor → enhancement

Comment 8

14 years ago
Another alternative is using inline script to focus the search form, which would
be invoked early (and not late as onLoad is). It could even be placed right
after rendering the search box (which is parsed early) to ensure nothing else
could have been focused (unless in the reload case).

How does that sound?
Inline script sounds like a good idea.


Comment 10

14 years ago
Created attachment 146128 [details] [diff] [review]
kiko_v2: inline script

Glad you liked it.
Attachment #144226 - Attachment is obsolete: true

Comment 11

14 years ago
Created attachment 146132 [details] [diff] [review]
kiko_v3: less braindead version for both specific and "regular" query

This is less broken, and does it for both pages.
Attachment #146128 - Attachment is obsolete: true

Comment 12

14 years ago
Comment on attachment 146132 [details] [diff] [review]
kiko_v3: less braindead version for both specific and "regular" query

Low-risk and a nice usability touch.
Attachment #146132 - Flags: review?(gerv)
Comment on attachment 146132 [details] [diff] [review]
kiko_v3: less braindead version for both specific and "regular" query


Attachment #146132 - Flags: review?(gerv) → review+


14 years ago
Flags: approval?
I still have my reservations on doing this on the advanced query page, but I
suppose we can back it out later if we get a lot of complaints.
Flags: approval? → approval+
checked in for kiko, since he's off wandering Europe somewhere. :)

Checking in template/en/default/search/form.html.tmpl;
<--  form.html.tmpl
new revision: 1.23; previous revision: 1.22
Checking in template/en/default/search/search-specific.html.tmpl;
 <--  search-specific.html.tmpl
new revision: 1.6; previous revision: 1.5
Last Resolved: 14 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.