Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18256] iOS: Setting TextField.value to wrong type triggers change event

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2020-07-28T21:35:19.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.1.0
ComponentsTiAPI
Labelsevents, textfield, type
ReporterFokke Zandbergen
AssigneeVijay Singh
Created2014-12-17T16:23:40.000+0000
Updated2020-07-28T21:35:19.000+0000

Description

Only on iOS, setting a TextField's (and probably others) value to the wrong type triggers the change event. The following code logs *is changed* once on iOS if you replace "hello" with 123, but doesn't log anything on Android. I expect the behaviour to be as on Android.
var w = Ti.UI.createWindow();
var t = Ti.UI.createTextField();
t.addEventListener('change', function(e) { console.debug('is changed'); });
w.add(t);
w.open();
t.value = 'hello';

Comments

  1. Vijay Singh 2020-06-17

    PR - https://github.com/appcelerator/titanium_mobile/pull/11778 Test Case -
       
       var win = Ti.UI.createWindow();
        
       var textFieldA = Titanium.UI.createTextField({
       	height:'35dip',
       	width:'100dip',
       	top:'60dip',
          	value:0,
       	font:{fontSize:'18sp', fontWeight:'normal', fontFamily:'Tahoma'},
       	color:'#808080'
       });
        
       win.add(textFieldA);
        
       textFieldA.addEventListener('change', function() {
       	Ti.API.info('Listener Called');
       });
        
       win.open();
       
  2. Satyam Sekhri 2020-06-30

    FR Passed. Waiting for Jenkins build
  3. Christopher Williams 2020-07-01

    merged to master for 9.1.0 target
  4. Satyam Sekhri 2020-07-28

    Verified on: Mac OS: 10.15.4 SDK: 9.1.0.v20200727104531 Appc CLI: 8.1.0-master.7 JDK: 11.0.4 Node: 10.17.0 Studio: 6.0.0.202005141803 Xcode: 12.0 Beta Device: iPhone 7Plus(v13.5.1), iOS simulator(v14.0Beta)

JSON Source