[TIMOB-17210] Android: TextField/TextArea "change" event should not trigger when setting "value" or "attributedString" properties
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-02-13T15:39:48.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.1.0 |
Components | Android |
Labels | android, listener, textarea, textfield |
Reporter | carlo |
Assignee | Maggie Chen |
Created | 2014-06-24T08:13:15.000+0000 |
Updated | 2018-03-05T23:58:15.000+0000 |
Description
Try the code below.
A textfield change listener is wrongly triggered also if the value is programmatically set before the creation.
This happen only on Android, and only if the change event listener is created after the ui thread.
var w = Ti.UI.createWindow({
layout:'vertical',
backgroundColor:'white'
});
var input = Ti.UI.createTextField({
width:"100%",
value:'default',
top:100
});
input.value = 'pre UI value';
input.addEventListener('change', function(e){
alert('this is alert is shown only on user input');
});
var button = Ti.UI.createButton({
title:"Set a new value and then add change listener"
});
button.addEventListener('click', function(){
input.value = 'new value';
input.addEventListener('change', function(e){
alert('this is alert is shown on android');
});
});
w.add(input);
w.add(button);
w.open();
Hi, Thank you for your ticket. I will forward this ticket to our engineer team. Regards, Shuo Liang
Tested with this code, when we change the textfield value programmatically, like above code: {quote}input.value = 'new value';{quote}. For android device, it will trigger change event, but for IOS device, it will not trigger change event.
Hi guys, any news on this? This bug causes a lot of trouble for me(tested with 6.3.0GA, on Android 7.1 Nexus 5X device and still present). Thanks
Hi guys, can you please fix it and implement to 7.0GA SDK release? Thanks
Hello guys, any news on this? I need this fixed to finish and release app. Thanks
Same here. +1
Hi Clément, did you find any workaround? I'm hopeless, that this bug is reported 3years ago and still not resolved and no one from Appc reacted to my requests... I have textfield and when I enter some value, tableview shows up with autocomplete suggestion. I click on tableview's row and it writes new value to textfield. Problem is, that when I click on tableview, it appears again and again(because of this bug). Thanks
PR https://github.com/appcelerator/titanium_mobile/pull/9700
Hi Maggie, how it is looking with review? When we can expect integration into SDK? Thanks
Hi guys, any news on this fix? I'm still waiting for this to be fixed, status says, that it's in review for 1 month and no information provided since then. Please post some new info when we can expect fix for this bug. Thanks
@Joshua Quick Hi Joshua, when we can expect release 7.1.0? Thanks
PR (7.1.x): https://github.com/appcelerator/titanium_mobile/pull/9834
Verified the fix in SDK 7.2.0.v20180302144729 & 7.1.0.v20180302141418. Closing. Studio Ver: 5.0.0.201712081732 OS Ver: 10.13.2 Xcode Ver: Xcode 9.2 Appc NPM: 4.2.12 Appc CLI: 7.0.2 Daemon Ver: 1.0.1 Ti CLI Ver: 5.0.14 Alloy Ver: 1.11.0 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 5 --- Android 6.0.1 ⇨ google Nexus 6P --- Android 8.0.0