Closed Bug 294208 Opened 20 years ago Closed 20 years ago

FAYT shoudn't be blocked when a form button, checkbox or a radio element is focused

Categories

(Toolkit :: Find Toolbar, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8final

People

(Reporter: asaf, Assigned: asaf)

References

Details

(Keywords: access)

Attachments

(1 file, 2 obsolete files)

The findbar implementaion blocks fayt whenever an <input> element is focused,
this (also) includes buttons, radios and checkboxes which are a no-real-blocker
to fayt.

(FYI, it's a ff-only bug, the xpfe version seems to work fine ;) )
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → Firefox1.1
Attached patch patch (obsolete) — Splinter Review
Attachment #183612 - Flags: review?(mconnor)
Summary: FAYT shoudn't be blocked when a from button, checkbox or a radio element is focused → FAYT shoudn't be blocked when a form button, checkbox or a radio element is focused
Comment on attachment 183612 [details] [diff] [review]
patch

I should use the type property; thanks for pointing out, Gavin.
Attachment #183612 - Flags: review?(mconnor)
Attached patch v1.1 (obsolete) — Splinter Review
Attachment #183612 - Attachment is obsolete: true
Attachment #183613 - Flags: review?(mconnor)
Blocks: deera11y
Attachment #183613 - Flags: review?(mconnor) → review+
Attachment #183613 - Flags: approval-aviary1.1a2?
Attachment #183613 - Flags: approval-aviary1.1a2? → approval-aviary1.1a2+
Checking in toolkit/components/typeaheadfind/content/findBar.js;
/cvsroot/mozilla/toolkit/components/typeaheadfind/content/findBar.js,v  <-- 
findBar.js
new revision: 1.12; previous revision: 1.11
done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Er.. So this code changed from being wrong to being wrong.  How about checking
instanceof on the element instead of checking localname?  <input> doesn't mean
"HTML input" by any means.
well, wrong to less wrong....

but yeah, lets get a new patch doing the right thing....
Status: RESOLVED → VERIFIED
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Attached patch v2Splinter Review
Attachment #183613 - Attachment is obsolete: true
Attachment #185804 - Flags: superreview?(bzbarsky)
Attachment #185804 - Flags: review?(mconnor)
Comment on attachment 185804 [details] [diff] [review]
v2

Looks ok, but maybe we should have a followup bug on having a saner way to do
this (eg when we get editable SVG ideally we wouldn't have to change this
code!)
Attachment #185804 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 185804 [details] [diff] [review]
v2

r=me with the indenting in the switch fixed.  Please do file the followup bz
suggested though.
Attachment #185804 - Flags: review?(mconnor) → review+
Attachment #185804 - Flags: approval-aviary1.1a2?
Attachment #185804 - Flags: approval-aviary1.1a2? → approval-aviary1.1a2+
will do.

Checking in findBar.js;
/cvsroot/mozilla/toolkit/components/typeaheadfind/content/findBar.js,v  <-- 
findBar.js
new revision: 1.13; previous revision: 1.12
done
Status: REOPENED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
Comment on attachment 185804 [details] [diff] [review]
v2

>   var elt = document.commandDispatcher.focusedElement;
>   if (elt) {
>+    if (elt instanceof HTMLInputElement) {
>+      // block FAYT when an <input> textfield element is focused
>+      var inputType = elt.type;
>+      switch (inputType) {
>+       case "text":
>+       case "password":
>+       case "file":
>+         return false;
>+      }
>     }
File inputs don't actually take focus in the normal scheme of things. Instead
you'll find that the .focusedElement is either the text or the button. They may
be some way of giving the file input container the focus, but in that case I
doubt it should block FAYT.

An alternative way of checking for text/password inputs is to access the
.controllers property which returns null for other types of inputs.

I don't know if it would be possible to add the event listener to the system
event group where it would fire after the input (or whichever) and hopefully be
able to tell if the event had already been handled.
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: