Opened 7 years ago

Closed 7 years ago

#16625 closed defect (worksforme)

Mobile Checkbox always reverting to initial State (V1.8.0)

Reported by: jjwalker31 Owned by: Douglas Hays
Priority: undecided Milestone: 1.8.3
Component: Dijit - Form Version: 1.8.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

In _ToggleButtonMisxin.js (lines 23-29)

	_onClick: function(/*Event*/ evt){
		var original = this.checked;
		this._set('checked', !original); // partially set the toggled value, assuming the toggle will work, so it can be overridden in the onclick handler
		var ret = this.inherited(arguments); // the user could reset the value here
		this.set('checked', ret ? this.checked : original); // officially set the toggled or user value, or reset it back
		return ret;
	},

(line 25) this._set('checked', !original); successfully changes checked value to the inverse of the original.

(line 26) var ret = this.inherited(arguments); Always returns as undefined.

Therefore(line 27) this.set('checked', ret ? this.checked : original); always reverts back to the original state. Commenting out of this line creates the excepted functionality.

Change History (3)

comment:1 Changed 7 years ago by bill

Component: GeneralDijit
Description: modified (diff)
Owner: set to bill

Either "Dijit - Form" or "DojoX Mobile" category but in either case sounds like Doug should handle this ticket.

Last edited 7 years ago by bill (previous) (diff)

comment:2 Changed 7 years ago by bill

Component: DijitDijit - Form
Owner: changed from bill to Douglas Hays

comment:3 Changed 7 years ago by Douglas Hays

Milestone: tbd1.8.3
Resolution: worksforme
Status: newclosed
Version: 1.8.21.8.0

I'm not seeing the problem. _ButtonMixin:_onClick is returning true (tested with dojox/mobile/tests/test_FormControls.html using 1.8.3). Maybe a web page's custom onClick handler is returning a bad value.

Note: See TracTickets for help on using tickets.