maui icon indicating copy to clipboard operation
maui copied to clipboard

[Mac Catalyst] Setting CancelButtonColor on SearchBar has no effect when using Mac Idiom

Open mikeparker104 opened this issue 1 year ago • 1 comments

Description

When adopting the Mac Idiom for a Mac Catalyst app, setting the CancelButtonColor on the SearchBar does not change the color of the cancel button.

Steps to Reproduce

  1. Create a File > New .NET MAUI app

  2. Specify the use of Mac Idiom as per the Specify the UI idiom for your Mac Catalyst app documentation

  3. Update the templated MainPage.xaml to include a SearchBar and explicitly set the CancelButtonColor to Red. For example:

    <VerticalStackLayout HorizontalOptions="Center" VerticalOptions="Center" Spacing="20">
        <SearchBar CancelButtonColor="Red" />
    </VerticalStackLayout>
    

Expected The color of the cancel button is Red.

Actual The color of the cancel button is not updated (default still applies).

Link to public reproduction project repository

No response

Version with bug

7.0.96

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

Ventura 13.6

Did you find any workaround?

Append to mapping to set the (UISearchBar) TintColor value based on the virtual view CancelButtonColor value.

SearchBarHandler.Mapper.AppendToMapping("UISearchBarTintColorWorkaround", (handler, view) =>
{
    handler.PlatformView.TintColor = view.CancelButtonColor.ToPlatform();
});

Relevant log output

No response

mikeparker104 avatar Oct 18 '23 13:10 mikeparker104

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 Oct 18 '23 14:10 ghost