Opened 10 years ago
Closed 10 years ago
#13286 closed defect (invalid)
dijit.form.RadioButton 's set() method doesn't appropriately handle the "name" property
Reported by: | kentonr | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | Dijit - Form | Version: | 1.6.1 |
Keywords: | radiobutton, set, name | Cc: | |
Blocked By: | Blocking: |
Description
Changing the "name" property on the dijit does not propagate the change to the underlying DOM node, which causes issues which can be demonstrated in the attachment.
Looking at the source code, when the user clicks on a radio button, the dijit performs a DOM query to find any other radio buttons and compares the 'name' property for a match (and unchecking them if they are checked). Since it is comparing against it's name property with a DOM node's name property, there is a mismatch between what the dijit's name property is versus the DOM node's name property and the radio button functionality is broken (you can select all of the radio buttons that were modified in this way).
I was able to work around it with this code: dijit.form.RadioButton?.prototype._setNameAttr = function(value) {
dojo.byId(this.id).name = value; this.name = value;
};
I can verify the defect exists in 1.6.0 and 1.6.1. My sample page uses the Google CDN. Clicking on the button will modify the radio buttons' name property for the first three radio buttons. Since they all are being set to the same value, it should function the same as before, but you run into this issue.
Attachments (1)
Change History (2)
Changed 10 years ago by
Attachment: | index.html added |
---|
comment:1 Changed 10 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
name is a constant string value. Changing it is not supported.
name: [const] String
Sample that uses the Google CDN to duplicate this issue.