Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8729] Android: TextField: Text is not visible, and view appears to redraw before keyboard is displayed

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2019-05-21T10:44:46.000+0000
Affected Version/sRelease 2.0.1, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsapi, qe-and040912
ReporterSitara Shylaja
AssigneeMaggie Chen
Created2012-04-13T16:40:23.000+0000
Updated2019-05-21T10:44:46.000+0000

Description

In TextField cannot see any texts that is being typed in and the cursor blinks outside the text field. For a second previous view is shown Steps to reproduce 1:Install and run the app 2: Tap inside the text field 3:type in word
var window = Ti.UI.createWindow({
    backgroundColor: 'blue'
});
var textField = Ti.UI.createTextField({
backgroundColor: '#fff',
height: 30,
top: 20,
left: 20,
right: 20
});
window.add(textField);
window.open();
Actual result: Could not see the text typed in,on focus the window returns to the previous view for a second. Expected result:should be able to see the text and the cursor should blink inside the text field *Note : this is not a regression bug,it goes back to 1.8.2*

Comments

  1. jithinpv 2013-02-26

    Issue is reproduced with sdk versions 3.0.2 and 3.1.0. Note: if height of the textfield is set to 'auto' or some dimension like 100(much greater than 30) it works fine.
  2. jithinpv 2013-02-26

    Issue is reproduced with sdk versions 3.0.2 and 3.1.0. Note: if height of the textfield is set to 'auto' or some dimension like 100(much greater than 30) it works fine.
  3. Marc Andrew Landles 2014-02-17

    SDK 3.2.0 still have the bug. The solution from jithinpv seems like a good workaround though. (height: 'auto')
  4. Maggie Chen 2017-07-11

    It is recommended to use the default font size of the system and let the TextField auto-size its height to fit (by default, height of the TextField is Ti.UI.SIZE). Please try to avoid hard coding the height of TextField and specify the text color in order to be visible.
       
       var window = Ti.UI.createWindow({
           backgroundColor: 'blue'
       });
       var textField = Ti.UI.createTextField({
       backgroundColor: '#fff',
       color:'blue',
       height: Ti.UI.SIZE,
       top: 20,
       left: 20,
       right: 20
       });
       window.add(textField);
       window.open();
       
       
    Please take note TextField Cursor is not visible on certain previous Android API levels as the native Android behaviour. Will open a separate ticket for the cursor issue.
  5. Samir Mohammed 2019-05-21

    Closing ticket, not able to reproduce using the instructions mentioned above. (Added colour property and setting the height to Ti.UI.SIZE adjusts its height according to the fontSize property if specified. *Test Environment*
       Google pixel xl 7.1.1 sim
       7.1.0-master.16
       Operating System Name: Mac OS Mojave
       Operating System Version: 10.14.2
       Node.js Version: 8.11.3
       

JSON Source