Opened 5 years ago

Last modified 5 years ago

#18048 closed defect

dojox/mobile/Switch: templating broken — at Version 3

Reported by: Adrian Vasiliu Owned by: Sebastien Pereira
Priority: undecided Milestone: 1.10
Component: DojoX Mobile Version: 1.10.0-beta1
Keywords: Cc: bill, Patrick Ruzand
Blocked By: Blocking:

Description (last modified by Adrian Vasiliu)

dojox/mobile/Switch is broken in the (optional) templated use-case.

How to reproduce: load dojox/mobile/tests/test_Templated-widgets.html in any browser: most of the time (not always, in particular on mobile devices), the layout of the page is broken and the console shows: parse() error, "Cannot set property 'width' of undefined"

This is a consequence of the new code introduced in Switch.js for #15076, more precisely the code introduced initially inside postCreate() (https://github.com/dojo/dojox/commit/5abd3a3fd5c8fc7237096a2d16bb38b45d5a526e) and later moved inside resize() (https://github.com/dojo/dojox/commit/5cfae8a68a6948baef4714cb36e068816efc7d88 ). Both variants of the code break the templating of the Switch.

The failure is because https://github.com/dojo/dojox/blob/master/mobile/Switch.js#L148 makes the blind assumption that the first child of this.left can be styled, which is not necessarily the case with a template. I have verified that the issue still hurts if (test_Templated-widgets.html is modified to use manual parsing instead of parseOnLoad:true.

Change History (3)

comment:1 Changed 5 years ago by Adrian Vasiliu

Description: modified (diff)

comment:2 Changed 5 years ago by Adrian Vasiliu

Owner: set to Sebastien Pereira
Status: newassigned

comment:3 Changed 5 years ago by Adrian Vasiliu

Description: modified (diff)
Note: See TracTickets for help on using tickets.