Opened 7 years ago

Closed 6 years ago

Last modified 5 years ago

#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)

switch_truncated_label.png (1.9 KB) - added by barbossusus 7 years ago.
15076.patch (10.0 KB) - added by Sebastien Pereira 6 years ago.
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).
15076.png (44.5 KB) - added by Sebastien Pereira 6 years ago.

Download all attachments as: .zip

Change History (25)

Changed 7 years ago by barbossusus

Attachment: switch_truncated_label.png added

comment:1 Changed 7 years ago by ykami

You need to override some styles. What version of dojo mobile are you using, 1.7 or trunk?

comment:2 Changed 7 years ago by ykami

Owner: changed from ykami to barbossusus
Status: newpending

comment:3 Changed 7 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

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 6 years ago by Eric Durocher

Resolution: invalid
Status: closedreopened

comment:5 Changed 6 years ago by Eric Durocher

Type: defectenhancement

comment:6 Changed 6 years ago by Sebastien Pereira

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.

Last edited 6 years ago by Sebastien Pereira (previous) (diff)

comment:7 Changed 6 years ago by Adrian Vasiliu

Milestone: tbd1.10

comment:8 Changed 6 years ago by Adrian Vasiliu

Owner: changed from barbossusus to Sebastien Pereira
Status: reopenedassigned

Changed 6 years ago by Sebastien Pereira

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 6 years ago by Sebastien Pereira

Attachment: 15076.png added

comment:9 Changed 6 years ago by Sebastien Pereira

comment:10 Changed 6 years ago by Sebastien Pereira

https://github.com/dojo/dojox/pull/10 updated to use CSS style "width" instead of custom property.

comment:11 Changed 6 years ago by Damien Mandrioli <dmandrioli@…>

Resolution: fixed
Status: assignedclosed

In 5abd3a3fd5c8fc7237096a2d16bb38b45d5a526e/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:12 Changed 6 years ago by Adrian Vasiliu <vasiliu@…>

In 13bdef6e70fc826529a3c3c597e1f4492fb41fd0/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:13 Changed 6 years ago by Adrian Vasiliu

Cc: Damien Mandrioli added

comment:14 Changed 6 years ago by Adrian Vasiliu

@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.

Last edited 6 years ago by Adrian Vasiliu (previous) (diff)

comment:15 Changed 6 years ago by Damien Mandrioli

Resolution: fixed
Status: closedreopened

comment:16 Changed 6 years ago by Damien Mandrioli

Reopened because this commit breaks todo-app dojox/app demo

comment:17 Changed 6 years ago by Sebastien Pereira

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 in reply to:  14 Changed 6 years ago by Sebastien Pereira

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:19 Changed 6 years ago by Adrian Vasiliu

@seb, thanks, please see my comments in the PR.

comment:20 Changed 6 years ago by Sebastien Pereira

#17336 is a duplicate of this ticket.

comment:21 Changed 6 years ago by Damien Mandrioli

Resolution: fixed
Status: reopenedclosed

comment:22 Changed 5 years ago by Adrian Vasiliu

This has a side-effect on the templating of the switch. See #18048.

Note: See TracTickets for help on using tickets.