Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10847] iOS: Setting .text on label Ti.UI.Label when .right is set causes jumping

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 2.1.2, Release 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelsapi, community
ReporterSindre Sorhus
AssigneeUnknown
Created2012-08-29T05:12:15.000+0000
Updated2018-02-28T20:03:15.000+0000

Description

Problem

When setting .text on a Ti.UI.Label component when the .right prop is set to something, like eg. 50, the new text jumps while rendering. I grabbed some screenshot of it happening (attached). First from setting a new text and then back to the old one. Notice how it jumps both ways.

Expected Behavior

The text should be set without any jump.

Test case

Ti.UI.backgroundColor = '#fff';

var win = Ti.UI.createWindow();

var label = Ti.UI.createLabel({
	right: 50
});

win.add( label );
win.open();

var t = true;
setInterval(function() {
	label.text = t ? 'string 1' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
	t = !t;
}, 2000);

Attachments

FileDateSize
1.png2012-08-29T05:12:15.000+000027957
2.png2012-08-29T05:12:15.000+000025910
3.png2012-08-29T05:12:15.000+000051593
4.png2012-08-29T05:12:15.000+000027236
5.png2012-08-29T05:12:15.000+000027110

Comments

  1. Sindre Sorhus 2012-10-19

    Any chance to get this fixed? Too be honest, I'm getting a little tired of this dance. I open a valid comprehensive bug report, you never fix...
  2. Ingo Muschenetz 2012-10-19

    Sindre, thank you for following up and for the bug report. I will bring this bug up for discussion to see when we can get it resolved.
  3. Sindre Sorhus 2013-03-01

    bump
  4. jithinpv 2013-05-06

    issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 iOS iPhone Simulator: iOS SDK version: 6.0

JSON Source