#15018 closed defect (fixed)
aspect.after discard "false" return values
Reported by: | ID | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | undecided | Milestone: | 1.8 |
Component: | Events | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
In the test below the submit should be blocked by the blockSubmit function but it doesn't work. The error lies within aspect.after which only replace the return value if it is true-ish instead of testing it being different then undefined.
<html> <head> <script src="dojo/dojo.js" data-dojo-config="async: true"></script> <script> require(["dojo/parser", "dijit/registry", "dijit/form/Form", "dojo/domReady!"], function(parser, registry){ var blockSubmit = function() { debugger; // Should block the submit action of the form return false; } parser.parse(); var form = registry.byId("myForm"); form.on("submit", blockSubmit); }); </script> </head> <body> <form data-dojo-type="dijit.form.Form" id="myForm"> <input type="submit" value="Click me" /> </form> <script>document.write("<span>Random number: "+Math.round(Math.random()*10000)+"</span>");</script> </body> </html>
I've attached a patch which solve this problem.
Attachments (1)
Change History (3)
Changed 9 years ago by
Attachment: | dojo_aspect.patch added |
---|
comment:2 Changed 9 years ago by
Milestone: | tbd → 1.8 |
---|
Note: See
TracTickets for help on using
tickets.
Test for different than undefined instead of true-ish