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-12139: Android: Textfield change event behaves differently in 2.1.4 and 3.0.0 SDK #4072
Conversation
…o fix the crash. fixed the "change"event.
{ | ||
|
||
if (maxLength >= 0 && editable.length() > maxLength) { | ||
isTruncatingText = 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.
why are you setting this to true then to false in the same function call?
Code reviewed. Please address comments. |
if (cursor > maxLength) { | ||
cursor = maxLength; | ||
} | ||
tv.setText(newText); |
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.
We set isTruncatingText to true in this if block because we truncate the characters and reset text. The function tv.setText(newText) here will directly invoke onTextChanged() and afterTextChanged() again. But maybe I should return here to make it more clear.
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.
return here would be a behavior change from this code. Can you comment on this code to make it more clear?
Updated. |
Code reviewed and functionally tested. Request accepted |
timob-12139: Android: Textfield change event behaves differently in 2.1.4 and 3.0.0 SDK
https://jira.appcelerator.org/browse/TIMOB-12139
Test steps in JIRA.