Getting some unexpected result on implementing #171 #5689
Replies: 3 comments 2 replies
-
So, I tried to check on develop branch . in the below logs, we can see when we input somthing (Let suppose "3"), the previous textviewmodel instances are triggering Textwatcher. I suspect that old used textwatchers are not removed properly when new TextInputInteractionView loads. Log : -
|
Beta Was this translation helpful? Give feedback.
-
so, I tried to remove old textWatcher. 1. @BindingAdapter("textChangedListener")
public static void bindTextWatcher(@NonNull EditText editText, TextWatcher textWatcher) {
TextWatcher existingWatcher = (TextWatcher) editText.getTag(R.id.textWatcher);
if (existingWatcher != null && existingWatcher != textWatcher) {
editText.removeTextChangedListener(existingWatcher);
}
if (textWatcher != null) {
editText.addTextChangedListener(textWatcher);
editText.setTag(R.id.textWatcher, textWatcher);
}
}
2. To tackle this issue.
Possible Reason to use maxLine
Screen Record : used.modify.bindtextwatcher.without.one.way.binding.mp4Log : -
Conclusion :
this problem was occurring on only for first edittext input. |
Beta Was this translation helpful? Give feedback.
-
@BenHenning , @adhiamboperes could you share your view on this solution? |
Beta Was this translation helpful? Give feedback.
-
I was trying to implement #171 as per Ben's suggestion. But I got some unexpected result in TextnputInteractionView.
Problem : - After submitting wrong answers, new TextInputInteractionView should be empty, but in this case, it was filled with previous submitted answer.
Screen Record :-
Problem.in.implementing.diffutil.mp4
Log : -
Beta Was this translation helpful? Give feedback.
All reactions