Closed Bug 154306 Opened 22 years ago Closed 22 years ago

oncommand for menuitem doesn't set event.button

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: ct-nebergall, Assigned: hyatt)

References

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1a+) Gecko/20020625

On a menuitem for oncommand event.button is never set.  This occurs no matter if
the menu item was clicked on or if it was activated by pressing enter.

Reproducible: Always
Steps to Reproduce:
check oncommand for a menuitem

Actual Results:  event.button always equals 65535

Expected Results:  event.button should equal 0 if a menuitem was clicked on with
a left click.  I'm not sure what the value should be if oncommand was fired in
another way.
Blocks: 59132
Component: XP Toolkit/Widgets: Menus → DOM Events
What use would the event.button be in this case?
On the current patch for bug 59132 where the oncommand even is sent through
handleLinkClick I'm forced to assume if button was not set that it really was
the first mouse button that was clicked.  Currently for link events
Enter+Modifer has the same required actions as Left Mouse button + modifier, but
I'm not sure this will always hold and I'd like to make my code good enough to
handle the cases where at some point in the future that statement is no longer
true.  Where this would really help is if middle click also fired oncommand.  I
could open a seperate bug on that if you want and put it dependent on this one?
 It would allow me not to mix oncommand and onclick for menuitems for bug 59132.
The reason I asked is that middle click should in fact not fire oncommand, imo,
and there seems to be no good reason to distinguish how oncommand was fired
(left click, enter, accesskey, space, etc).  If such a need is felt, then
oncommand is not the right event to hook into.
resolving wontfix per coments,please reopen if i misunderstood.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.