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

Rotation clears inputTextField.text #76

Open
walsh2000 opened this issue Aug 27, 2015 · 1 comment
Open

Rotation clears inputTextField.text #76

walsh2000 opened this issue Aug 27, 2015 · 1 comment

Comments

@walsh2000
Copy link

Hello

-[VENTokenField layoutInputTextFieldWithCurrentX:currentY:] clears inputTextField.text

This is great for clearing the text field when the user calls reloadData, but when we're laying out because of rotation, it causes us to lose our input.

Would you be open to a PR which keeps the existing behavior of clearing the inputTextField on reloadData, but keeps the entered text on relayout ?

@walsh2000
Copy link
Author

It turns out that the PR could be very simple.
We're already passing a boolean for whether to adjust the frame or not.
All the cases where we're adjusting the frame we also want the inputTextField cleared, so we could add a parameter to layoutInputTextFieldWithCurrentX & use that to clear/not-clear the text field.

I'll submit a PR. Hopefully you're open to the change.

walsh2000 pushed a commit to walsh2000/VENTokenField that referenced this issue Aug 27, 2015
This resolves issue venmo#76
When we are laying out subviews, we were already passing NO for adjustFrame.
When we are reloading data, we were already passing YES for adjustFrame.

It turns out that when we are not adjustingFrame, we do not want to clear the user-entered text, so reuse this boolean to keep from clearing the user text.
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

No branches or pull requests

1 participant