New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-17210] Android: Fixed TextField/TextArea to not trigger "change" event when setting properties #9700
Conversation
Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maggieaxway, can you also fix this for the attributedString
property too please? I've confirmed that changing the attributedString
property for TextField and TextArea fires a change
event as well.
Side Note:
I've confirmed that iOS TextFields and TextAreas do not fire a "change" event for value
and attributedString
property changes.
@@ -825,10 +828,13 @@ public void setAttributedStringText(AttributedStringProxy attrString) | |||
Bundle bundleText = | |||
AttributedStringProxy.toSpannableInBundle(attrString, TiApplication.getAppCurrentActivity()); | |||
if (bundleText.containsKey(TiC.PROPERTY_ATTRIBUTED_STRING)) { | |||
//TIMOB-17210 Android: A textfield change listener is wrongly triggered also if the value is programmatically set before creation | |||
disableChangeEvent = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this code block's disableChangeEvent
handling to the following please?
boolean wasDisabled = disableChangeEvent;
disableChangeEvent = true;
/* ... */
disableChangeEvent = wasDisabled;
The reason is because the processProperties()
method already sets the disableChangeEvent
to true
and this method call will end up changing it back to false
too soon. The above code will change it back to its original state. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right! I was still thinking why it's using wasDisabled. Thanks for the explanation :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: Pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FR passed.
Tested using the test case the ticket and above, the event is only triggered when the text is changed by the user and not programmatically set.
It is now the same as iOS
ENV
SDK Version : 7.0.2.GA, Local 7.1.0
macOS Sierra 10.13.3
Google Pixel 2 XL (8.1.0)
android emulator (7.1.1)
iOS simulator (11.2)
Appc CLI : 7.0.3-master.3
Appc NPM : 4.2.12
Node : v8.9.1
@maggieaxway What release is this ticket scheduled for? |
Let's get it into 7.1.0. (I just updated the ticket.) |
@jquick-axway Would you be able to create a backport for 7_1_X |
@longton95, here is the back-port: #9834 |
JIRA: https://jira.appcelerator.org/browse/TIMOB-17210
Please test in both Android and iOS.
Test case: