#15064 closed defect (fixed)
better handling of setTimeout in mobile
Reported by: | ben hockey | Owned by: | Adrian Vasiliu |
---|---|---|---|
Priority: | undecided | Milestone: | 1.9 |
Component: | DojoX Mobile | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
the setTimeout
calls used extensively throughout dojox/mobile (particularly the longer ones) should be tracked and if there are any outstanding timeouts when a widget is destroyed, those should be cleared. _WidgetBase has a defer
function to help with this that might be useful.
in particular, there is one specific call in _ItemBase that is constantly causing problems in an app i'm working on when the widgets are destroyed before that setTimeout completes:
setTimeout(function(){ _this.set("selected", false); }, this._duration);
this._duration
is 800ms by default and by the time that function is called, the domNode has been set to null
and causes all kinds of problems. this setTimeout
should be cleared in the destroy
of the widget.
Attachments (4)
Change History (12)
comment:1 Changed 9 years ago by
comment:2 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|---|
Owner: | changed from ykami to Eric Durocher |
Status: | new → assigned |
I think this one was fixed to use defer(). Eric can you check if we have other ones that should use defer() and are not? And if yes I think it would be good to have them fixed in 1.9.
comment:3 Changed 8 years ago by
Owner: | changed from Eric Durocher to Adrian Vasiliu |
---|
Changed 8 years ago by
Attachment: | patch15064.patch added |
---|
Use of widget.defer() instead of setTimeout. This fixes some cases of failures when destroying the widget. Includes DOH testing. - Adrian Vasiliu (IBM, CCLA)
Changed 8 years ago by
Attachment: | patch15064-fix.patch added |
---|
Fix in previous patch (removal of widget.defer) - Adrian Vasiliu (IBM, CCLA)
Changed 8 years ago by
Attachment: | patch15064-fix2.patch added |
---|
Remove unnecessary lang.hitch when using widget.defer (done anyway internally by widget.defer) - Adrian Vasiliu (IBM, CCLA)
Changed 8 years ago by
Attachment: | patch15064-fix3.patch added |
---|
scrollable: do not use widget.defer() because this module is not always mixed into a widget - Adrian Vasiliu (IBM, CCLA)
You should use _WidgetBase::defer() (added by Doug).