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
[TextFields] Add identity check in -setTextColor: in MDCTextField #9480
[TextFields] Add identity check in -setTextColor: in MDCTextField #9480
Conversation
How did you verify that this fixes the issue? |
I built the app and added a bunch of breakpoints and eventually zeroed in on which method calls were necessary to trigger the infinite loop and then found a way to make it so they weren't made again and again and again. It's bizarre. There's some interplay between the layout process of the text field and some "safeAreaInsetsDidChange" logic in flexible header that is just no good! |
Oh and I updated the PR description to link to the bug which links to some before and after gifs |
bazel detected changes to the following targets:
|
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.
I'd maybe add a comment above the textColor != self.textColor
check mentioning why you added it, just in case someone thinks it's an unnecessary optimization somewhere down the line.
Good idea, I'll do that |
) This PR adds an identity check in `-setTextColor:` in MDCTextField. This identity check short circuits an infinite loop triggered by `-setTextColor:` under certain mysterious circumstances involving the MDCTextField layout pass and MDCFlexibleHeaderView KVO stuff surrounding safeAreaInset changes. I don't fully understand what's going on tbh :) The internal bug ([b/148159587](http://b/148159587)) has links to before and after gifs in the comments. Closes #9470 ### Update: The internal client who reported the bug was unable to reproduce it with these changes.
This PR adds an identity check in
-setTextColor:
in MDCTextField. This identity check short circuits an infinite loop triggered by-setTextColor:
under certain mysterious circumstances involving the MDCTextField layout pass and MDCFlexibleHeaderView KVO stuff surrounding safeAreaInset changes. I don't fully understand what's going on tbh :)The internal bug (b/148159587) has links to before and after gifs in the comments.
Closes #9470
Update: The internal client who reported the bug was unable to reproduce it with these changes.