Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10639] MobileWeb: Textfield hides hintText when value is set to empty

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-09-17T08:18:21.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Sprint 2012-19 JS, 2012 Sprint 19
ComponentsMobileWeb
Labelsqe-port
ReporterAlexander Miller
AssigneeBryan Hughes
Created2012-08-27T10:33:48.000+0000
Updated2012-12-06T19:38:48.000+0000

Description

Mobileweb Textfield hides hintText if value is set to an empty string

When creating a textfield with no value and hintText of 'required', setting the value to '' will cause the value to be shown instead of the hintText in mobileweb even though the value is empty. This works correctly in iOS as a comparison.

Steps to reroduce:

1. Copy the code below into a new project 2. Run using MobileWeb 3. Note the textfield has no text 4. Run using iOS 5. Note the textfield says 'Required'

CODE:

var win  = Ti.UI.createWindow({
	backgroundColor: 'white'
});
win.open();
var view = Ti.UI.createView({
	height: 500,
	width: 500,
	backgroundColor: 'blue'
});
var text = Ti.UI.createTextField({
	hintText: 'Required',
	backgroundColor: '#FFF',
	width: 200,
	height: 60
});
view.add(text);
//This line should not cause the hintText to disappear
text.value = '';

win.add(view);

Attachments

FileDateSize
app.js2012-09-14T10:45:00.000+00003067
app.js2012-09-12T10:44:11.000+00002903
app.js2012-09-11T13:52:17.000+00001828

Comments

  1. Bryan Hughes 2012-09-11

    Pull Request: https://github.com/appcelerator/titanium_mobile/pull/2907
  2. Tamila Smolich 2012-12-06

    Closing as fixed. Tested on: Titanium Studio, build: 3.0.0.201211301903 Titanium SDK, build: 3.0.0.v20121204181658 Device: iPhone 4 (5.1.1) Mac OS X Lion 10.7.5 - Safari Version 5.1.7, Google Chrome Version 23.0.1271.95

JSON Source