maui icon indicating copy to clipboard operation
maui copied to clipboard

[Shell][iOS] Shell search handler icon error after popping modal

Open kklose23 opened this issue 1 year ago • 3 comments

Description

Null ref exception after popping a modal when the ClearPlaceholderIcon is set in IOS

Steps to Reproduce

  1. Follow these steps https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/search?view=net-maui-7.0
  2. Create a constructor for the AnimalSearchHandler and set ClearPlaceholderIcon= "placeholder_icon.png"; within the constructor
  3. Run the application in an IOS simulator
  4. Push a modal on the stack
  5. 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)

kklose23 avatar Apr 06 '23 15:04 kklose23

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.

ghost avatar Apr 10 '23 14:04 ghost

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)

jinxinjuan avatar Aug 14 '23 05:08 jinxinjuan

Verified this issue with Visual Studio Enterprise 17.8.5,Microsoft.Maui.Controls 8.0.6 and .NET 8 is still happening.

vitorelli avatar Jan 25 '24 14:01 vitorelli