Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10686] iOS:Textfield:'Click' event always taking precedence to 'Focus' event,making textfield un-editable.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-27T08:53:57.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.2
ComponentsiOS
Labelsapi, look1, qe-ios082012
ReporterShyam Bhadauria
AssigneeShameer Jan
Created2012-08-28T06:47:13.000+0000
Updated2017-03-28T17:23:41.000+0000

Description

This is not a regression.'Click' event did not fired at all till 2.1.2. Till 2.1.2, no 'click' event is fired on textfield. In 2.2.0, when 'click' and 'focus' both events are added to a textfield, 'click' event always gets fired on clicking textfield. So the user is unable to edit the textfield. Note: Sometimes both event fire for the first time. But afterwards,it follows the bug. Steps to reproduce. 1. Run the code below on simulator
var win = Ti.UI.createWindow({ backgroundColor: '#fff', title: 'Focus Consistency Test' });

var textField = Ti.UI.createTextField({
    top: 50, left: 10, right: 10,
    height: 50,
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
});

win.add(textField);

textField.addEventListener('focus',function(){
	alert('tf focus fired');
});
textField.addEventListener('click',function(){
	alert('tf click fired');
});

var textField1 = Ti.UI.createTextField({
    top: 120, left: 10, right: 10,
    height: 50,
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED
    //focusable : false
});

textField1.addEventListener('focus',function(){
	alert('tf1 focus fired');
});

var textField2 = Ti.UI.createTextField({
    top: 220, left: 10, right: 10,
    height: 50,
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED
    //focusable : false
});

textField2.addEventListener('click',function(){
	alert('tf2 click fired');
});

win.add(textField1);
win.add(textField2);
win.open();
2. Click the top most textfield(tf) 3. Click the middle textfield(tf1) 4. Click the bottom most textfield(tf2) Expected result 2. Afte step 2, the focus and click event should get fired on textfield and it should become editable. 3. After step 3, the focus event should get fired on textfield and it should become editable. 4. After step 4, the 'click' event should get fired on textfield and it should become editable. Actual result 2. Afte step 2, the click event is fired on textfield and it do not becomes editable. 3. After step 3, the focus event gets fired on textfield and it becomes editable. 4. After step 4, the 'click' event gets fired on textfield and it do not becomes editable.

Comments

  1. Shameer Jan 2013-03-27

    Issue does not reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 5.1, 6.0
  2. Lee Morris 2017-03-28

    Can verify this ticket as "Cannot Reproduce". Tested with the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80

JSON Source