-
-
Notifications
You must be signed in to change notification settings - Fork 510
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
SearchBar Cancel tap causes panel to dismiss #248
Comments
Could you tell me the following information?
|
simulator iOS version: 12.2 |
Thanks, @swiftymf. I tried to repro this issue on 2 cases with Examples/Maps app, but I'm not able to do that...
I wonder if what is the difference between your app and Examples/Maps. |
Could it be because I’m adding the searchBar this way tableView.tableaheaderView = searchViewController.searchBar, instead of in storyboard? |
I've understood this issue after my investigation for a while. In conclusion, we're not able to use UISearchController with FloatingPanelController by the system design. This is because UISearchController automatically presents itself modally when a user interacts with the search bar. When it displays, it swaps the superview of the search bar into the view managed by itself from the table view. As a result, FloatingPanelController can't control the search bar when UISearchController is active, as you can see from this screen shot. I tried to find a workaround, including new APIs on iOS 13, but I was not able to find it. |
was there a solution found for this? any workaround. am experiencing the same issue |
|
I have a searchBar in the tableHeaderView. Panel moves to .full when textField becomes active. If I tap the Cancel button the panel slides completely off the screen. As far as I can tell my code is almost identical to the Maps Sample project with similar functionality. I've checked delegates, positions when cancel is pressed, etc. If I change the position from .full to .half in searchBarTextDidBeginEditing it will change when I run the project. However when I make any change to searchBarCancelButtonClicked it will still fully slide the panel off the screen. I put a print statement in searchBarCancelButtonClicked to make sure it gets called when the button is pressed and it does. Not sure where else it would be dismissing the entire panel. Thanks in advance for your help and this awesome library!
EDIT: by setting definesPresentationContext to false, pressing Cancel on the searchBar now allows the tableView to go to .half position. However, if the searchBar's textField is active and you attempt to drag the view down manually, the searchBar stays at the top of the screen while the rest of the view slides down.
The text was updated successfully, but these errors were encountered: