Opened 5 years ago
Closed 5 years ago
#18848 closed defect (fixed)
dojox/mobile/Switch renders improperly because resize() is not called on startup
Reported by: | Martin Minka | Owned by: | dylan |
---|---|---|---|
Priority: | undecided | Milestone: | 1.10.6 |
Component: | Dojox | Version: | 1.11.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
fix implemented in ticket #18353 causes that resize() is never called on startup.
this causes that the switch is not correctly rendered
Change History (4)
comment:2 Changed 5 years ago by
Note that startup() is really only supposed to call resize() if the widget isn't the child of a layout widget, as per this code in dijit/layout/_LayoutWidget.js:
if(!(parent && parent.isLayoutContainer)){ // Do recursive sizing and layout of all my descendants // (passing in no argument to resize means that it has to glean the size itself) this.resize(); // Since my parent isn't a layout container, and my style *may be* width=height=100% // or something similar (either set directly or via a CSS class), // monitor when viewport size changes so that I can re-layout. this.own(Viewport.on("resize", lang.hitch(this, "resize"))); }
In your case it might not hurt to call resize() unconditionally on startup()... it depends if the resize() code throws an exception if it's run while the Switch is hidden.
comment:3 Changed 5 years ago by
@bill, thank you for comment.
I suggest to create other pull request if there is more improvement needed then my simple regression.
The resize() code was always called before #18353 and it is never called after. Not calling resize() causes wrong rendering of the switch element on page.
comment:4 Changed 5 years ago by
Milestone: | tbd → 1.10.6 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Thanks for the PR. Fixed in https://github.com/dojo/dojox/commit/082aa526ad413807ec1db816efb6f42bffacc496 and backported as https://github.com/dojo/dojox/commit/567978b4cb7a432a5221a63195aa8a66fbe1feb5 (1.11) and https://github.com/dojo/dojox/commit/dd06578b09266b2f9cf61965aad1f8186d5555bd (1.10).
should be fixed inhttps://github.com/dojo/dojox/pull/236