Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25477] Android: Tapping right-aligned TextField not always receiving focus as of 6.2.2

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-12-15T18:13:24.000+0000
Affected Version/sRelease 6.2.2
Fix Version/sRelease 7.0.1
ComponentsAndroid
Labelsandroid, textfield
ReporterMichael Gangolf
AssigneeJoshua Quick
Created2017-11-02T19:10:30.000+0000
Updated2017-12-20T22:29:39.000+0000

Description

*Problem:* In a right aligned TextField (2nd and last in example) it is difficult to select the text by clicking in the the TextField area. *Testdevice:* HTC A9 (Android 7) *SDK Versions* - 6.2.1.GA working - 6.2.2.GA+ not working This PR: https://github.com/appcelerator/titanium_mobile/pull/9433 was between 6.2.1 and 6.2.2 so it might give a hint. *Example*
var win = Ti.UI.createWindow({
	backgroundColor: '#fff',
	layout: "vertical"
});
 
var tf1 = Ti.UI.createTextField({
	width: Ti.UI.FILL,
	top: 10,
	height: 40,
	borderColor:"#000",
	borderWidth:1,
	bottom: 10
});
var tf2 = Ti.UI.createTextField({
	width: Ti.UI.FILL,
	top: 10,
	height: 40,
	borderColor:"#000",
	borderWidth:1,
	bottom: 10,
	textAlign:Ti.UI.TEXT_ALIGNMENT_RIGHT
});
var tf3 = Ti.UI.createTextField({
	width: Ti.UI.FILL,
	top: 10,
	height: 40,
	borderColor:"#000",
	borderWidth:1,
	bottom: 10,
	textAlign:Ti.UI.TEXT_ALIGNMENT_RIGHT
});
 
win.add(tf1);
win.add(tf2);
win.add(tf3);
win.open();
*Additional info by [~jquick]* {quote} I'm able to reproduce this issue on an Android 7.1 Pixel XL with right-aligned TextFields, but not left-aligned or center-aligned TextFields. Also, I'm NOT able to reproduce this issue with right-aligned TextFields on an Android 5.0 Moto G or Android 4.1 Galaxy Nexus. Hmm... this requires further investigation. {quote}

Comments

  1. Fabian Martinez 2017-11-10

    I'm having the same issue. Right aligned textfields are impossible to tap so they get focused and show the keyboard. If changed to Left aligned they work. This used to work on SDK 6.2.1.GA with Android 4.1.2. On 6.2.2.GA and 6.3.0.GA these fields are not working on this Android version, they work on newer android though.
  2. Joshua Quick 2017-11-10

    [~inzori], just to confirm, you're saying you can reproduce this issue on Android 4.1.2? That's odd, because I'm unable to reproduce it on an Android 4.1 or 5.0 device. (See my note above.) If you tested it on a physical device, then can you tell us the make and model please? Thanks!
  3. Fabian Martinez 2017-11-13

    Sorry Joshua, it is on Android 4.4.2. I was able to reproduce it on a Motorola XT891 and we have reports from customers on Galaxy S5 Android v 4.4.2.
  4. Joshua Quick 2017-11-13

    Hmm... perhaps this issue is just more likely to happen on a high DPI screen then. I suspect a touch-move event is triggering this bad behavior and you're more likely to fat-finger a touch-move event on a high DPI screen. We'll look into it. The good news is that left and center alignment work fine, but I can understand you not wanting to use these alignments for numeric fields.
  5. Fabian Martinez 2017-11-13

    Hi Joshua, no we can't have center or left alignment there. As an additional info, sometimes when tapping 4-5 times the field gains focus and shows the keyboard.
  6. Joshua Quick 2017-11-23

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9624
  7. Michael Gangolf 2017-11-28

    Made a custom 6.3.1 with this patch and right aligned text works fine again!
  8. Joshua Quick 2017-12-07

    PR (7.0.x): https://github.com/appcelerator/titanium_mobile/pull/9662
  9. Abir Mukherjee 2017-12-12

    FR passed for both master and 7.0.1.
  10. Lokesh Choudhary 2017-12-20

    Master PR merged.
  11. Samir Mohammed 2017-12-20

    Closing ticket. Verified Fix in SDK version 7.0.1.v20171218104141 and 7.1.0.v20171220095337. Test and other information can be found at: Master: https://github.com/appcelerator/titanium_mobile/pull/9624 7.0.x: https://github.com/appcelerator/titanium_mobile/pull/9662

JSON Source