<button type="checkbox"> oncommand does not have checked state updated yet




12 years ago
5 years ago


(Reporter: BenB, Unassigned)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



12 years ago
<checkbox id="A" type"checkbox" oncommand="text(e);" />
<button id="B" type"checkbox" oncommand="text(e);" />
<button id="C" type"checkbox" />
function test(e)
   dump(e.id + " is checked: " + e.hasAttribute("checked") + "\n");
document.getElementById("C").oncommand = test;

Actual result:
"A is checked: true" when you switch A from unpressed to pressed
"B is checked: false" when you switch B from unpressed to pressed
"C is checked: true" when you switch C from unpressed to pressed

Expected result:
All widgets/handlers behave the same. All reflect the new state, i.e. show "is checked: true" when going from unpressed to pressed and "is checked: false" when going from pressed to unpressed.

Probably, the implementation of <button type="checkbox"> has oncommand handler itself which sets the checked/not checked state, and the widget's oncommand handler competes with the caller's oncommand handler on execution order. This does not happen for <checkbox>.

Comment 1

12 years ago
Created attachment 267450 [details]
Another testcase, from Martijn Gerrits

Comment 2

11 years ago
The same seems to be the case for <toolbarbutton> in firefox, while it works in seamonkey 1.1.3
Assignee: jag → nobody
You need to log in before you can comment on or make changes to this bug.