Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10156] MobileWeb: IE9/Chrome not showing or incorrectly showing the value of the textfields when text is aligned

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-08-09T15:04:21.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sSprint 2012-16 API, Release 3.0.0
ComponentsMobileWeb
Labelsapi, qe-port
ReporterReymundo López
AssigneeBryan Hughes
Created2012-07-25T15:27:29.000+0000
Updated2012-08-10T15:09:45.000+0000

Description

On IE if the width of the textField is too low, and the textAlign is set to TEXT_ALIGNMENT_CENTER, the value does not show until the user type something, but if the width is high enough the value is show but with a wrong alignment. On Google Chrome the value is never displayed until the user types something in the field. Steps to reproduce: 1 - Create app with this code:
var win = Ti.UI.createWindow({
    backgroundColor:'#ffffff'
});

var textField1 = Ti.UI.createTextField({
    right : 170,
    top : 102,
    width : 200,
    height : 36,
    borderStyle : Ti.UI.INPUT_BORDERSTYLE_LINE,
    backgroundColor : 'white',
    textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,
    value: 1,
    font : { fontSize : 24 }
});

var textField2 = Ti.UI.createTextField({
	right : 170,
    top : 190,
    width : 50,
    height : 36,
    borderStyle : Ti.UI.INPUT_BORDERSTYLE_LINE,
    backgroundColor : 'white',
    textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,
    value: 1,
    font : { fontSize : 24 }
});

mainView.add(textField1);
mainView.add(textField2);

win.add(mainView);
win.open();
2 - Preview on the browser Actual result (images attached): IE9 does not show the value with the correct alignment and uses an arbitrary size for the textField, the value only appears when the user types something. Chrome does not show the value until the user types something. Expected result: The textField shows the value with the correct alignment independently of the size of the textField

Attachments

FileDateSize
Chrome.png2012-07-25T15:27:29.000+00004004
IE9 - TextField.png2012-07-25T15:27:29.000+00004285
Safari - TextField.png2012-07-25T15:27:29.000+00004250

Comments

  1. Bryan Hughes 2012-08-07

    Pull Request: https://github.com/appcelerator/titanium_mobile/pull/2692
  2. Lokesh Choudhary 2012-08-10

    Verified fix on: Titanium studio : 2.1.1.201207271312 SDK version : 2.2.0.v20120810080115 Android 4.0.4 - default ,chrome 18.0 Iphone 4.3.5 - safari mobile Mountain lion(10.8) - chrome 21.0,safari 6,firefox 14.0.1

JSON Source