[Dojo-checkins] doughays - r22550 - in dijit/trunk: form tests/form/robot

dojo-checkins-admin at dojotoolkit.org dojo-checkins-admin at dojotoolkit.org
Fri Jul 23 12:47:12 EDT 2010


Author: doughays
Date: Fri Jul 23 09:47:03 2010
New Revision: 22550

Modified:
   dijit/trunk/form/_FormWidget.js
   dijit/trunk/tests/form/robot/_autoComplete_a11y.html
Log:
Fixes #11062.  Initialize _lastReportedValue along with resetValue so that the first onChange is ignored.  Added automated testcase.

Modified: dijit/trunk/form/_FormWidget.js
==============================================================================
--- dijit/trunk/form/_FormWidget.js	(original)
+++ dijit/trunk/form/_FormWidget.js	Fri Jul 23 09:47:03 2010
@@ -289,7 +289,7 @@
 		// Update our reset value if it hasn't yet been set (because this.set()
 		// is only called when there *is* a value)
 		if(this._resetValue === undefined){
-			this._resetValue = this.value;
+			this._lastValueReported = this._resetValue = this.value;
 		}
 	},
 

Modified: dijit/trunk/tests/form/robot/_autoComplete_a11y.html
==============================================================================
--- dijit/trunk/tests/form/robot/_autoComplete_a11y.html	(original)
+++ dijit/trunk/tests/form/robot/_autoComplete_a11y.html	Fri Jul 23 09:47:03 2010
@@ -934,6 +934,30 @@
 				}
 			]);
 
+			doh.register("onChange", [
+				{
+					timeout:6000,
+					name:"11062",
+					runTest:function(){
+						var d = new doh.Deferred();
+						var combo = dijit.byId("progCombo");
+						var status = "not called";
+						var connectHandle = combo.connect(combo, "onChange", function(){
+							status = "called";
+						});
+						combo.focusNode.focus();
+						doh.robot.keyPress(dojo.keys.TAB, 500); // blur
+
+						doh.robot.sequence(d.getTestCallback(function(){
+							combo.disconnect(connectHandle);
+							doh.is("not called", status, "onChange should not have been called");
+						}), 500);
+
+						return d;
+					}
+				}
+			]);
+
 			doh.run();
 		});
 	</script>


More information about the Dojo-checkins mailing list