#15076 closed enhancement (fixed)
Switch (mobile) control does not stretch
Reported by: | barbossusus | Owned by: | Sebastien Pereira |
---|---|---|---|
Priority: | undecided | Milestone: | 1.10 |
Component: | DojoX Mobile | Version: | 1.7.2 |
Keywords: | Cc: | Damien Mandrioli | |
Blocked By: | Blocking: |
Description
Switch (mobile) control does not stretch to accommodate for large labels.
By executing the following code, switch control labels are truncated:
var someSwitch = new Switch({ value: "on", leftLabel: "thisIsAnExtraLongStringLeftLabel", rightLabel: "thisIsAnExtraLongStringRightLabel" }, someinputElement); someSwitch.startup();
Attachments (3)
Change History (25)
Changed 9 years ago by
Attachment: | switch_truncated_label.png added |
---|
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Owner: | changed from ykami to barbossusus |
---|---|
Status: | new → pending |
comment:3 Changed 9 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
comment:4 Changed 8 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
comment:5 Changed 8 years ago by
Type: | defect → enhancement |
---|
comment:6 Changed 8 years ago by
A new property customWidth in dojox.mobile.Switch widgets will allow to easily specify the widget width if the label does not fit with the default width 100px. Example of usage:
<div data-dojo-type="dojox.mobile.Switch" value="off" leftLabel="Enabled" rightLabel="Disabled" customWidth=120 > </div>
Display results with a 120 custom width to display labels Start/Stop, Opened/Closed, Enabled/Disabled.
comment:7 Changed 8 years ago by
Milestone: | tbd → 1.10 |
---|
comment:8 Changed 8 years ago by
Owner: | changed from barbossusus to Sebastien Pereira |
---|---|
Status: | reopened → assigned |
Changed 8 years ago by
Attachment: | 15076.patch added |
---|
This patch introduce a new property *customWidth* for dojox.mobile.Switch widgets. This property allows to override the default width without having to deal with CSS properties. Also contains updates of Switch test cases (Sebastien Pereira, IBM CCLA).
Changed 8 years ago by
comment:10 Changed 8 years ago by
https://github.com/dojo/dojox/pull/10 updated to use CSS style "width" instead of custom property.
comment:11 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:13 Changed 8 years ago by
Cc: | Damien Mandrioli added |
---|
comment:14 follow-up: 18 Changed 8 years ago by
@seb, wouldn't be nice to add a note to the doc (reference and maybe API too) about the new feature?
@dmandrioli, let's not forget to also commit it for D2.
comment:15 Changed 8 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:17 Changed 8 years ago by
It broke todo-app dojox/app demo because custom sizing calculations were done in the postCreate function. It is now done in resize(), called from startup() to ensure the widget is attached to the DOM.
Fix in PR46: https://github.com/dojo/dojox/pull/46
comment:18 Changed 8 years ago by
Replying to Adrian:
@seb, wouldn't be nice to add a note to the doc (reference and maybe API too) about the new feature?
Adrian, I've made this PR to address this point: https://github.com/dojo/docs/pull/94
comment:21 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:22 Changed 7 years ago by
This has a side-effect on the templating of the switch. See #18048.
You need to override some styles. What version of dojo mobile are you using, 1.7 or trunk?