Closed Bug 288797 Opened 20 years ago Closed 20 years ago

Alt-c on the search bar generates JS console error

Categories

(SeaMonkey :: MailNews: Message Display, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: iannbugzilla, Assigned: iannbugzilla)

Details

Attachments

(1 file, 2 obsolete files)

This ports TB bug 239482 to mailnews and also fixes an issue with the Clear
button when nothing had focus prior to activating it.
Error in JS console is:
Error: focusedElement has no properties
Source File: chrome://messenger/content/searchBar.js
Line: 504
Attached patch Patch v0.1 (obsolete) — Splinter Review
This patch:
* Adds Ctrl-k as key for focusing to search box
* Fixes problem on clearing search box
Assignee: sspitzer → bugzilla
Status: NEW → ASSIGNED
Attachment #179422 - Flags: review?(neil.parkwaycc.co.uk)
conflicts with bug 66884?
Comment on attachment 179422 [details] [diff] [review]
Patch v0.1

We already have Alt+S to focus the search bar. And we don't have to maintain
parity with the Firefox Google search bar. And we probably should find an
alternate element to focus before the clear button gets disabled.
Attachment #179422 - Flags: review?(neil.parkwaycc.co.uk) → review-
Summary: ctrl-k should shift focus to the search bar → Alt-c on the search bar generates JS console error
Attached patch Revised patch v0.1a (obsolete) — Splinter Review
Changes since v0.1
* Dropped all changes apart from post clear button focus problem fix
* If gLastFocusedElement does not exist then focus on thread tree
Attachment #179422 - Attachment is obsolete: true
Attachment #179461 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 179461 [details] [diff] [review]
Revised patch v0.1a

>+  var focusedElement = gLastFocusedElement ? gLastFocusedElement : GetThreadTree();
Nit: Use || here (remember in JavaScript x || y is x ? x : y)

>+  if (focusedElement)
>+    focusedElement.focus();
We don't need this bit now surely?

r=me with these nits fixed.
Attachment #179461 - Flags: review?(neil.parkwaycc.co.uk)
Changes since v0.1a
* Revised from ? to || as per Neil's request

Carried forward r=
Attachment #179461 - Attachment is obsolete: true
Attachment #179505 - Flags: superreview?(bienvenu)
Attachment #179505 - Flags: review+
Attachment #179505 - Flags: superreview?(bienvenu) → superreview+
Comment on attachment 179505 [details] [diff] [review]
Updated patch v0.1b (Checked in)

Checking in searchBar.js;
/cvsroot/mozilla/mailnews/base/resources/content/searchBar.js,v  <-- 
searchBar.js
new revision: 1.40; previous revision: 1.39
done
Attachment #179505 - Attachment description: Updated patch v0.1b → Updated patch v0.1b (Checked in)
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Verified FIXED using build 2006-01-06-09 of trunk SeaMonkey under Windows XP.
Status: RESOLVED → VERIFIED
Component: MailNews: Search → MailNews: Message Display
QA Contact: search
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: