Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mikeparker104 opened this issue Oct 18, 2023 · 1 comment · Fixed by #19838
Assignees
Labels
legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor partner/cat 😻 Client CAT Team partner Issue or Request from a partner team platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working
Milestone

Comments

@mikeparker104
Copy link
Contributor

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 mikeparker104 added the t/bug Something isn't working label Oct 18, 2023
@ghost ghost added the partner Issue or Request from a partner team label Oct 18, 2023
@mikeparker104 mikeparker104 added the partner/cat 😻 Client CAT Team label Oct 18, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Oct 18, 2023
@ghost
Copy link

ghost commented Oct 18, 2023

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.

@jsuarezruiz jsuarezruiz self-assigned this Oct 18, 2023
@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Oct 30, 2023
@jsuarezruiz jsuarezruiz removed their assignment Jan 11, 2024
@mikeparker104 mikeparker104 self-assigned this Jan 11, 2024
mikeparker104 added a commit that referenced this issue Jan 12, 2024
… Mac Idiom (#19838)

### Description of Change

Update to ```SearchBarExtensions``` so ```UpdateCancelButton``` sets the
```TintColor``` on the Cancel ```UIButton``` when using Mac idiom.
Device test added verifying the changes for Mac Catalyst and iOS.

### Issues Fixed

Fixes [#18110](#18110)
@samhouts samhouts added the platform/macOS 🍏 macOS / Mac Catalyst label Feb 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor partner/cat 😻 Client CAT Team partner Issue or Request from a partner team platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working
Projects
None yet
4 participants