Hitting enter should not fire oncommand on xul checkboxes

RESOLVED FIXED

Status

RESOLVED FIXED
16 years ago
10 years ago

People

(Reporter: aaronlev, Assigned: aaronlev)

Tracking

(Blocks: 1 bug, {access})

Trunk
x86
Windows 2000
access

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

16 years ago
Steps:
1. Go to Preferences - Advanced - Keyboard navigation
2. Type Alt+L to toggle links checkbox
3. Select OK to accept pref changes
4. Return to Keyboard navigation panel

Notice that the checkbox state has changed back. The change never took affect.
If you use space bar or click the checkbox it works.

We use oncommand on that checkbox, because the pref is represented by a
bitfield. The oncommand is not being fired.

This may be a dup of bug 90318, or at least it may solve that problem if we fix
this.
Keywords: nsbeta1
(Assignee)

Comment 1

16 years ago
Resummarizing -- the problem is that hitting the accesskey clicks and focuses
the checkbox (and correctly fires the oncommand), but hitting Enter for OK is
triggering the oncommand a second time.
Summary: Hitting accesskey doesn't fire oncommand for xul elements → Hitting enter should not fire oncommand on xul checkboxes

Comment 2

16 years ago
adt: nsbeta1-
Keywords: nsbeta1 → nsbeta1-
(Assignee)

Comment 3

16 years ago
The problem is that Enter on a buttonboxframe fires oncommand, whether the
buttonboxframe is really for a button or not -- it could actually be used for a
xul checkbox as well. If it's a checkbox, we don't want to fire oncommand for
Enter key.

This appears to be from

118 hewitt    1.13         if (NS_VK_RETURN == keyEvent->keyCode) {

119 blakeross 1.8             MouseClicked(aPresContext, aEvent);
120                        }

The checkin comment for 1.13 is
1.13 <hewitt@netscape.com> 18 Oct 2001 22:02
84602 - when a button has focus, enter key doesn't fire oncommand (from blake),
r=hyatt, sr=hewitt

However, it appears to be blake's patch.
(Assignee)

Comment 4

16 years ago
Created attachment 127164 [details] [diff] [review]
Check element to make sure it's a XUL button, before using Enter key for oncommand
(Assignee)

Updated

16 years ago
Attachment #127164 - Flags: superreview?(hewitt)
Attachment #127164 - Flags: review?(blaker)

Comment 5

16 years ago
Comment on attachment 127164 [details] [diff] [review]
Check element to make sure it's a XUL button, before using Enter key for oncommand

r=hewitt
Attachment #127164 - Flags: review?(blaker) → review+
(Assignee)

Updated

16 years ago
Attachment #127164 - Flags: superreview?(hewitt) → superreview?(jst)
Comment on attachment 127164 [details] [diff] [review]
Check element to make sure it's a XUL button, before using Enter key for oncommand

sr=jst
Attachment #127164 - Flags: superreview?(jst) → superreview+
(Assignee)

Comment 7

16 years ago
Checked into 1.5b trunk.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED

Comment 8

16 years ago
S'pose the command event could have been done in XBL...
(Assignee)

Comment 9

16 years ago
Neil, why do we need a special kind of frame for XUL buttons anyway. Shouldn't
all that functionality be implemented with XBL?
Product: Core → SeaMonkey
You need to log in before you can comment on or make changes to this bug.