Listening for a submit event from a dijit/Form/form using DojoX Mobile has stopped working in Chrome on Android. This used to work, but doesn't anymore:
<form data-dojo-type="dijit/form/Form">
<input data-dojo-type="dojox/mobile/TextBox"
name="user" placeholder="Email"> <br />
<input data-dojo-type="dojox/mobile/TextBox" placeholder="Password"
name="pass" type="password"> <br />
<button data-dojo-type="dojox/mobile/Button" type="submit">Log In</button>
</form>
on(registry.byId('loginForm'), 'submit', function (evt) {
evt.preventDefault();
if (!this.isValid()) { return; }
alert('valid submit fired');
});
After doing some digging, I've found that it started happening in Chrome 53. Testing this fiddle with the dev tools and the device emulator in Chrome 52 works, but gives this warning in the console:
A DOM Event generated from JavaScript has triggered a default action inside the browser. This behavior is non-standard and will be removed in M53, around September 2016. See https://www.chromestatus.com/features/5718803933560832 for more details.
My guess is that it's coming from a synthesized, un-trusted event within DojoX (and that Chrome page points that direction as well), since a plain <input type="submit" value="Log In"> successfully fires the event, but adding dojox/mobile/button causes it to fail.
Is this a bug that hasn't been addressed in Dojo (I've tested with 1.10.4 and 1.11.2)? Do I just need to use a workaround and have two separate listeners - one for the submit (i.e. the user hits enter) and one for the button click?