[iOS] SearchHandler overlaps title and title view - fix#30772
[iOS] SearchHandler overlaps title and title view - fix#30772jfversluis merged 3 commits intodotnet:inflight/currentfrom
Conversation
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
@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