Skip to content
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

Fix issue where the textfield would be cleared when losing focus iOS 10 #19

Merged
merged 4 commits into from
Apr 16, 2019

Conversation

jvanzummeren
Copy link
Collaborator

Solves #4

Bug was caused by overwriting text and attributedText and setting the getter value to nil

Copy link
Owner

@luximetr luximetr left a comment

Choose a reason for hiding this comment

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

I am not sure about this. Probably i had problems connected with that. I need time to remember and test this.

@jvanzummeren
Copy link
Collaborator Author

jvanzummeren commented Apr 16, 2019

I understand, it's a sort of fundamental change. A few additional comments to make you feel more comfortable with the fix.

  1. I changed the implementation to make use of the 'content' and 'attributedContent' instead of calling super to make it more in line with the existing implementation.
  2. I tested it on iOS 10, 11 and 12
  3. Only iOS 10 is calling the 'original' attributedText property when 'resigning FirstResponder', although iOS 10, 11 and 12 call it when backspacing last character
  4. I tested it with both starting with nothing, programatically setting .content and/or .attributedContent

:)

@luximetr luximetr merged commit 5a5b7bf into master Apr 16, 2019
@luximetr luximetr deleted the textfield_bug_ios_10 branch January 9, 2020 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants