#16067 closed defect (fixed)
dojox/mobile/_ItemBase.onTouchStart() is running setTimeout() callback even if the widget has been destroyed
Reported by: | Ed Chatelain | Owned by: | Eric Durocher |
---|---|---|---|
Priority: | high | Milestone: | 1.9 |
Component: | DojoX Mobile | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
_ItemBase.onTouchStart() is running setTimeout() callback even if the widget has been destroyed. In a dojox/mvc/test we had to add code to avoid a JavaScript? error in our "delete" code because this line is being called even if the item has been destroyed. this._selTimer = setTimeout(lang.hitch(this, function(){ this.set("selected", true); }), 100);
To see the problem you can update dojox/mvc/tests/mobile/demo/src.js and comment out the aspect.around(ListItem?... code, then hit dojox/mvc/tests/mobile/demo/demo.html and select the "WidgetList? Data Binding" item, then select the delete icon.
_ItemBase should be checking this so that we would not have to check it in out testcase.
Attachments (2)
Change History (9)
comment:1 Changed 8 years ago by
Priority: | undecided → high |
---|
comment:2 Changed 8 years ago by
Thanks Ed for pointing it out. Once the patch will be committed, you can remove your workaround...
comment:3 Changed 8 years ago by
The patch looks good, thank you. One minor comment is that I wouldn't give a new line for '100);'.
Changed 8 years ago by
Attachment: | patch16067.patch added |
---|
_ItemBase: avoid the risk of running the setTimeout function on destroyed widgets - Adrian Vasiliu, IBM, CCLA
comment:4 Changed 8 years ago by
Okay, I've changed it into '}, 100);' such that it is consistent with the formatting of the this.defer in "handleSelection".
comment:6 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|
Changed 8 years ago by
Attachment: | patch16067-fix.patch added |
---|
Fix and cleanup - Adrian Vasiliu (IBM, CCLA)
_WidgetBase.defer should probably be used instead of setTimeout.