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

Fixed dropdown when textfield is placed in a UITableView #30

Merged
merged 1 commit into from
May 13, 2014

Conversation

mikumi
Copy link
Contributor

@mikumi mikumi commented May 13, 2014

The dropdown will be attached to the rootview instead of the superview. That way dropdown items can be selected even when placed in a UITableView. Positioning in a UITableView has also been fixed.

EddyBorja added a commit that referenced this pull request May 13, 2014
Fixed dropdown when textfield is placed in a UITableView
@EddyBorja EddyBorja merged commit 712380b into EddyBorja:master May 13, 2014
@mikumi mikumi mentioned this pull request May 14, 2014
gbarcena pushed a commit to gbarcena/MLPAutoCompleteTextField that referenced this pull request Jul 16, 2014
This reverts commit 712380b, reversing
changes made to a306304.

Conflicts:
	MLPAutoCompleteTextField/MLPAutoCompleteTextField.m
@gbarcena
Copy link
Contributor

This merge causes problems for my code. I think it might have to do with the fact that the root view is UILayoutContainerView. I think the solution referenced in #7 might be more appropriate (although somewhat inelegant).

@mikumi Do you think you could explain what positioning problems you were still having in comment #7 (comment)? Maybe a different solution could be found.

@mikumi
Copy link
Contributor Author

mikumi commented Jul 18, 2014

The positioning-problem I was having was that the autocompletion-Table was placed inside the textfield. Actually, the current version is doing that again I think (something changed after my merge) and I am using a modified version for myself locally (haven't committed these changes yet, sorry).
What kind of problems are you having exactly?

@EddyBorja
Copy link
Owner

I think mikumi's original change had caused another bug, and in the process
of fixing it the positioning problem has re-emerged.

Keep in mind the drop down table is supposed to appear slightly beneath the
textfield itself, but not on top of it.

On Fri, Jul 18, 2014 at 12:58 AM, mikumi notifications@github.com wrote:

The positioning-problem I was having was that the autocompletion-Table was
placed inside the textfield. Actually, the current version is doing that
again I think (something changed after my merge) and I am using a modified
version for myself locally (haven't committed these changes yet, sorry).
What kind of problems are you having exactly?


Reply to this email directly or view it on GitHub
#30 (comment)
.

@gbarcena
Copy link
Contributor

My problem is that the rootView of from the window is not the superview of the autocompleteTextView. So when the autoCompleteTableView is added, it is added to UILayoutContainerView and cant be place below the textview. I edited the demo code in my fork to show my issue. It can be switched between the two placement styles with a #define

@kurtzmarc
Copy link
Contributor

I just wanted to report that this change causes issues for me. When I scroll my tableview the autocomplete view doesn't scroll with the table and just stays where it is. Before this, it works perfectly. I don't know much more at this point, but if I find anything I'll post it. Maybe someone has had a similar experience.

@gbarcena
Copy link
Contributor

@kurtzmarc The problem you are having is probably the fact that the autocompleteview is not being added to the tableview (/associated scrollview) with this fix. The sample project doesn't really show the issue off very well. If you look at my branch and edit the BROKEN macro you can see what is happening.

@kurtzmarc
Copy link
Contributor

It seems like your BROKEN macro reverts the changes from this revision to get it to work again. Is that the best workaround? Is this a known issue?

@gbarcena
Copy link
Contributor

Well its kind of a hard problem to solve because you want the autocomplete cells to work when they are in another smaller table view cell. To fix that people tried adding view to the root view in this fix. The problem with that is the root view is probably not the table view and in my experience it has been UILayoutContainerView which is a private-ish class we know little about.

There is another fix referenced in #7 that talks about creating a property of a target view to add the autocompletetableview to. The fix I think would be best is using the old superview functionality since that is appropriate for most situations and adding an optional property to specify the target view when that doesn't work. I haven't submitted a pull request with the fix because it was inelegant and was hoping someone else might have a better idea.

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.

None yet

4 participants