Skip to content

Fix UITextField with cornerRadius #83

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

Merged
merged 12 commits into from
Mar 17, 2021
Merged

Conversation

JannThomas
Copy link
Collaborator

@JannThomas JannThomas commented Mar 16, 2021

This PR fixes #6. It adds the findAncestorOrAncestorChild function on UIView, which is used by the new TargetViewSelector.siblingContainingOrAncestorOrAncestorChild function to retrieve not only sibling containing or ancestors, but also children of ancestors.

The testTextField Test is also updated to reflect this change and test whether three UITextField next to each other are differentiated correctly, with two of them showcasing the strange behavior that appears when .cornerRadius() is added after the introspection.

@JannThomas JannThomas requested a review from SplittyDev March 16, 2021 17:59
@JannThomas JannThomas self-assigned this Mar 16, 2021
@JannThomas
Copy link
Collaborator Author

This is not a complete fix and has to be reevaluated since adding two UITextField with cornerRadius within the same scope now produces a bug where the first one is always introspected.

We might wanna print a debug message to lead the package user in the right direction when someone does this?

Copy link
Collaborator

@SplittyDev SplittyDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this tbh. Introducing possibly wrong behavior and notifying the user via a debug message doesn't seem like a good way to go about this.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Mar 17, 2021
@JannThomas
Copy link
Collaborator Author

This now uses the UIKit frames to find the right view to introspect.

@JannThomas JannThomas requested a review from SplittyDev March 17, 2021 18:51
Copy link
Collaborator

@SplittyDev SplittyDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, just a few things I don't like here.

Copy link
Collaborator

@SplittyDev SplittyDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's wait for CI and then 🚀

@JannThomas JannThomas merged commit 07a80dd into master Mar 17, 2021
@ben73 ben73 mentioned this pull request Nov 30, 2021
@davdroman davdroman deleted the fix-textfield-with-cornerradius branch June 2, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextField.introspectTextField not calling
2 participants