maui
maui copied to clipboard
[Shell][iOS] Shell search handler icon error after popping modal
Description
Null ref exception after popping a modal when the ClearPlaceholderIcon
is set in IOS
Steps to Reproduce
- Follow these steps https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/search?view=net-maui-7.0
- Create a constructor for the
AnimalSearchHandler
and setClearPlaceholderIcon= "placeholder_icon.png";
within the constructor - Run the application in an IOS simulator
- Push a modal on the stack
- Pop the modal
Link to public reproduction project repository
N/A
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 16.2
Did you find any workaround?
Setting TextColor
on the search handler fixes the problem
Relevant log output
at Microsoft.Maui.Platform.ColorExtensions.ToPlatform(Color color)
at Microsoft.Maui.Controls.Platform.Compatibility.SearchHandlerAppearanceTracker.UpdateClearPlaceholderIconColor(Color targetColor)
at Microsoft.Maui.Controls.Platform.Compatibility.SearchHandlerAppearanceTracker.UpdateTextColor(UITextField textField)
at Microsoft.Maui.Controls.Platform.Compatibility.SearchHandlerAppearanceTracker.UpdateSearchBarColors()
at Microsoft.Maui.Controls.Platform.Compatibility.ShellPageRendererTracker.PageAppearing(Object sender, EventArgs e)
at Microsoft.Maui.Controls.Page.SendAppearing()
at Microsoft.Maui.Controls.ShellContent.SendPageAppearing(Page page)
at Microsoft.Maui.Controls.ShellContent.SendAppearing()
at Microsoft.Maui.Controls.ShellSection.PresentedPageAppearing()
at Microsoft.Maui.Controls.ShellSection.SendAppearing()
at Microsoft.Maui.Controls.ShellItem.SendAppearing()
at Microsoft.Maui.Controls.Shell.NavigationImpl.OnPopModal(Boolean animated)
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.
Verified this issue with Visual Studio Enterprise 17.8.0 Preview 1.0. Can repro on iOS platform with sample project. maui-samples/7.0/Fundamentals/Shell at main · dotnet/maui-samples (github.com)
Verified this issue with Visual Studio Enterprise 17.8.5,Microsoft.Maui.Controls 8.0.6 and .NET 8 is still happening.