-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] SearchHandler overlaps title and title view - fix #30772
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where the SearchHandler overlaps with the title and title view on iOS by properly managing the search controller's active state when editing stops. The fix ensures that when a user finishes editing the search bar, the search controller is properly deactivated to prevent visual overlap.
- Adds proper handling for search bar editing completion to deactivate the search controller
- Implements platform-specific logic for iOS 11+ vs earlier versions
- Ensures proper cleanup of event handlers to prevent memory leaks
| _searchHandlerAppearanceTracker.Dispose(); | ||
| _searchHandlerAppearanceTracker = null; | ||
|
|
||
| var searchBar = _searchController.SearchBar; |
Copilot
AI
Jul 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a null check for _searchController before accessing SearchBar to prevent potential NullReferenceException during cleanup.
|
|
||
| var searchBar = _searchController.SearchBar; | ||
| searchBar.OnEditingStopped -= OnSearchBarEditingStopped; | ||
| searchBar.BookmarkButtonClicked -= BookmarkButtonClicked; |
Copilot
AI
Jul 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The BookmarkButtonClicked event handler is being unsubscribed in the cleanup method, but it was already being handled elsewhere in the existing code. This duplication could lead to attempting to unsubscribe an already unsubscribed handler.
| searchBar.BookmarkButtonClicked -= BookmarkButtonClicked; | |
| if (BookmarkButtonClicked != null) | |
| searchBar.BookmarkButtonClicked -= BookmarkButtonClicked; |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/rebase |
40e9687 to
57332e2
Compare
|
/rebase |
57332e2 to
0a918ac
Compare
jsuarezruiz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kubaflo Could you rebase and fix the conflict?
done :) |
|
/rebase |
8c1f751 to
105792a
Compare
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Added support for the OnEditingStopped event on the SearchBar in ShellPageRendererTracker for iOS. This ensures the search controller is deactivated when editing stops and properly unsubscribes from the event during disposal to prevent memory leaks.
* Added a UI Test * Added snapshots * Handle SearchBar editing stopped event on iOS Added support for the OnEditingStopped event on the SearchBar in ShellPageRendererTracker for iOS. This ensures the search controller is deactivated when editing stops and properly unsubscribes from the event during disposal to prevent memory leaks.
* Added a UI Test * Added snapshots * Handle SearchBar editing stopped event on iOS Added support for the OnEditingStopped event on the SearchBar in ShellPageRendererTracker for iOS. This ensures the search controller is deactivated when editing stops and properly unsubscribes from the event during disposal to prevent memory leaks.
* Added a UI Test * Added snapshots * Handle SearchBar editing stopped event on iOS Added support for the OnEditingStopped event on the SearchBar in ShellPageRendererTracker for iOS. This ensures the search controller is deactivated when editing stops and properly unsubscribes from the event during disposal to prevent memory leaks.
* Added a UI Test * Added snapshots * Handle SearchBar editing stopped event on iOS Added support for the OnEditingStopped event on the SearchBar in ShellPageRendererTracker for iOS. This ensures the search controller is deactivated when editing stops and properly unsubscribes from the event during disposal to prevent memory leaks.
* Added a UI Test * Added snapshots * Handle SearchBar editing stopped event on iOS Added support for the OnEditingStopped event on the SearchBar in ShellPageRendererTracker for iOS. This ensures the search controller is deactivated when editing stops and properly unsubscribes from the event during disposal to prevent memory leaks.
* Added a UI Test * Added snapshots * Handle SearchBar editing stopped event on iOS Added support for the OnEditingStopped event on the SearchBar in ShellPageRendererTracker for iOS. This ensures the search controller is deactivated when editing stops and properly unsubscribes from the event during disposal to prevent memory leaks.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issues Fixed
Fixes #30771
Screen.Recording.2025-07-23.at.02.02.14.mov
Screen.Recording.2025-07-23.at.02.00.50.mov