Opened 13 years ago

Closed 12 years ago

#2148 closed defect (fixed)

dojo.widget.Button.setDisable(true) multiple calls makes multiple add of "dojoButtonDisabled" CSS class

Reported by: damien.feugas@… Owned by: Douglas Hays
Priority: high Milestone: 0.9
Component: Widgets Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:

Description

In dojo.widget.Button class, the method _sizeMyselfHelper() used by setDisabled() prepend multiple time the dojoButtonDisabled Css class.

And when you try to enable the button, the only "one" Css class is removed, and the button is style disabled (cursor, and text).

In code :

if ( this.disabled ) {
    dojo.html.prependClass(this.domNode, "dojoButtonDisabled");
   this.domNode.removeAttribute("tabIndex");
   dojo.widget.wai.setAttr(this.domNode, "waiState", "disabled", true);
} else {
   dojo.html.removeClass(this.domNode, "dojoButtonDisabled");
   this.domNode.setAttribute("tabIndex", "0");
   dojo.widget.wai.setAttr(this.domNode, "waiState", "disabled", false);
}

the line :

dojo.html.prependClass(this.domNode, "dojoButtonDisabled");

may be perhaps

dojo.html.addClass(this.domNode, "dojoButtonDisabled");

Change History (2)

comment:1 Changed 13 years ago by bill

Milestone: 0.5
Owner: changed from bill to Douglas Hays

Assigning to Doug since he's doing button stuff.

comment:2 Changed 12 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [7083]) Fixes #1987, #1666, #2148.

Note: See TracTickets for help on using tickets.