Closed Bug 471229 Opened 16 years ago Closed 15 years ago

can't type an apostrophe or parenthesis in text fields

Categories

(Toolkit Graveyard :: Spatial Navigation, defect)

defect
Not set
major

Tracking

(fennec1.0b3+)

VERIFIED FIXED
Tracking Status
fennec 1.0b3+ ---

People

(Reporter: db48x, Assigned: tonikitoo)

References

Details

(Keywords: mobile)

Attachments

(1 file, 2 obsolete files)

instesd it selects the previous field, which is  rather unexpected and dangerous; try it in a bug description. perhaps it activates snav?
reproducible. taking
Assignee: nobody → tonikitoo
Status: NEW → ASSIGNED
tracking-fennec: --- → ?
tracking-fennec: ? → 1.0b3+
err , i was the root of the problem.

that is where we are breaking:

http://mxr.mozilla.org/mozilla-central/source/toolkit/spatial-navigation/SpatialNavigation.js#92
dougt, I actually changed my mind from bug 463139, where I accidentally broken this. I explain: we have different keys that share the same |event.which| and |event.keyCode| codes. e.g.

keyCode for ARROW_RIGHT -> 39
charCode for APOSTOPHE -> 39

when user types the character ' then snav assumes it is an arrow press, once we are using event.which. that is bad...
Attachment #380995 - Flags: review?(doug.turner)
Component: General → Spatial Navigation
Keywords: mobile
Product: Fennec → Toolkit
QA Contact: general → spatial.navigation
antonio,
would it be better to check to see if keyCode == charCode, then use event.keyCode.  Otherwise use (event.which || event.keyCode).
(In reply to comment #5)
> antonio,
> would it be better to check to see if keyCode == charCode, then use
> event.keyCode.  Otherwise use (event.which || event.keyCode).

This fails. Antonio's fix works.
this also affects non mobile.
Severity: normal → major
OS: Linux → All
Hardware: Other → All
Summary: cant type an apostrophe in text fields → can't type an apostrophe or parenthesis in text fields
Alternative solution for the problem.

1) It basically adds a special handling for when event.charCode is equal the one of the arrow keys keyCode.

it fixes apostrophe and parenthesis cases, and similar ones ...
Attachment #380995 - Attachment is obsolete: true
Attachment #385933 - Flags: review?(doug.turner)
Attachment #380995 - Flags: review?(doug.turner)
Comment on attachment 385933 [details] [diff] [review]
patch 0.2 - simple fix for the problem

lets not use comparison operators, but use explicit checks against the values in nsIDOMKeyEvent.*.  I do not think they will change, but I am not sure that there is a guarantee.
Attachment #385933 - Flags: review?(doug.turner) → review-
(In reply to comment #9)
> (From update of attachment 385933 [details] [diff] [review])
> lets not use comparison operators, but use explicit checks against the values
> in nsIDOMKeyEvent.*.  I do not think they will change, but I am not sure that
> there is a guarantee.
Attachment #385933 - Attachment is obsolete: true
Attachment #386078 - Flags: review?(doug.turner)
(In reply to comment #9)
> (From update of attachment 385933 [details] [diff] [review])
> lets not use comparison operators, but use explicit checks against the values
> in nsIDOMKeyEvent.*.  I do not think they will change, but I am not sure that
> there is a guarantee.

suggestion addressed.

patch also changes the order of the snav.enabled pref status check to be the first thing to be checked before going on...
Attachment #386078 - Flags: review?(doug.turner) → review+
Antonio - fix the spacing on the "||"  please?

+       key == Ci.nsIDOMKeyEvent.DOM_VK_RIGHT|| key == Ci.nsIDOMKeyEvent.DOM_VK_UP))
fixed.

changeset:   29918:ebbcf6317c98
tag:         tip
user:        Antonio Gomes (tonikitoo) <tonikitoo@gmail.com>
date:        Tue Jun 30 16:35:53 2009 -0400
summary:     Bug 471229 - can't type an apostrophe or parenthesis in text fields. r=dougt
(In reply to comment #12)

> Antonio - fix the spacing on the "||"  please?
> 
> +       key == Ci.nsIDOMKeyEvent.DOM_VK_RIGHT|| key ==
> Ci.nsIDOMKeyEvent.DOM_VK_UP))

done

daniel, timeless: please verify
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Blocks: 492409
verified with beta3 on my n810
Status: RESOLVED → VERIFIED
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: