Skip to content

Conversation

@kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Jul 23, 2025

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

Before After
Screen.Recording.2025-07-23.at.02.02.14.mov
Screen.Recording.2025-07-23.at.02.00.50.mov

Copilot AI review requested due to automatic review settings July 23, 2025 00:10
@kubaflo kubaflo requested a review from a team as a code owner July 23, 2025 00:10
@kubaflo kubaflo self-assigned this Jul 23, 2025
Copy link
Contributor

Copilot AI left a 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;
Copy link

Copilot AI Jul 23, 2025

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.

Copilot uses AI. Check for mistakes.

var searchBar = _searchController.SearchBar;
searchBar.OnEditingStopped -= OnSearchBarEditingStopped;
searchBar.BookmarkButtonClicked -= BookmarkButtonClicked;
Copy link

Copilot AI Jul 23, 2025

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.

Suggested change
searchBar.BookmarkButtonClicked -= BookmarkButtonClicked;
if (BookmarkButtonClicked != null)
searchBar.BookmarkButtonClicked -= BookmarkButtonClicked;

Copilot uses AI. Check for mistakes.
@kubaflo kubaflo changed the title [iOS] SearchHandler overlaps title and title view [iOS] SearchHandler overlaps title and title view - fix Jul 23, 2025
@PureWeen
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen modified the milestones: .NET 9 SR10, .NET 9 SR12 Aug 4, 2025
@jsuarezruiz
Copy link
Contributor

/rebase

@jsuarezruiz
Copy link
Contributor

/rebase

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a 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?

@kubaflo
Copy link
Contributor Author

kubaflo commented Oct 30, 2025

@kubaflo Could you rebase and fix the conflict?

done :)

@jfversluis
Copy link
Member

/rebase

@github-project-automation github-project-automation bot moved this from Todo to Approved in MAUI SDK Ongoing Dec 1, 2025
@jfversluis
Copy link
Member

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jfversluis jfversluis changed the base branch from main to inflight/current December 2, 2025 13:05
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.
@jfversluis jfversluis merged commit ee5cf37 into dotnet:inflight/current Dec 2, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Dec 2, 2025
PureWeen pushed a commit that referenced this pull request Dec 3, 2025
* 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.
PureWeen pushed a commit that referenced this pull request Dec 3, 2025
* 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.
PureWeen pushed a commit that referenced this pull request Dec 3, 2025
* 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.
PureWeen pushed a commit that referenced this pull request Dec 3, 2025
* 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.
PureWeen pushed a commit that referenced this pull request Dec 3, 2025
* 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.
github-actions bot pushed a commit that referenced this pull request Dec 5, 2025
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[iOS] SearchHandler overlaps title and title view

4 participants