Initial button background while disabled not set

I updated to 25.1.35 and the background of the button when disabled is behaving differently than in version 24.

I use the style below:

            <Style TargetType="buttons:SfButton">

                <Setter Property="TextColor" Value="Black" />

                <Setter Property="FontFamily" Value="OpenSansRegular"/>

                <Setter Property="FontSize" Value="Medium"/>

                <Setter Property="CornerRadius" Value="8"/>

                <Setter Property="Padding" Value="14,10"/>

                <Setter Property="Background" Value="{StaticResource Tertiary}" />

                <Setter Property="VisualStateManager.VisualStateGroups">

                    <VisualStateGroupList>

                        <VisualStateGroup x:Name="CommonStates">

                            <VisualState x:Name="Normal"/>

                            <VisualState x:Name="Disabled">

                                <VisualState.Setters>

                                    <Setter Property="Opacity" Value="0.5" />

                                </VisualState.Setters>

                            </VisualState>

                        </VisualStateGroup>

                    </VisualStateGroupList>

                </Setter>

            </Style>

In disabled state the background color is not set. But when I change a property in the style with Hot Reload the background changes to the correct color.

This code was working in version 24.



4 Replies

CA CasperF March 19, 2024 09:37 AM UTC

I have this same issue since upgrading to the latest version. Hot reload correctly sets the color, but then rebuilding the app resets the styling so all disabled buttons get a default gray background



KP Kamalesh Periyasamy Syncfusion Team March 21, 2024 12:50 PM UTC

Hi Ruud,

 

We are able to reproduce the reported issue "Initial button background color while disabled not set" and we have fixed the reported issue. At present, a custom patch has been created for version 25.1.35. We have attached the NuGet file for your convenience.

 

Please note that we have created this patch for version 25.1.35 specifically to resolve the issue reported in this ticket. If you have received other patches for the same version for other products, please apply all patches in the order received.

 

Note: Please refer to the below link to apply the custom patch.

https://www.syncfusion.com/kb/6987/how-to-clear-nuget-cache

 

We will include the fix in our upcoming weekly release on April 02, 2024. We appreciate your patience until then.

 

Disclaimer: The inclusion of this solution in the weekly release may change due to other factors, including but not limited to QA checks and work reprioritization.

 

Root Cause & Solution:

In the current Volume 1 main release, we have implemented theme support for all Syncfusion controls in .NET MAUI. For our theme design, we have adopted the Material 3 Design guidelines. Upon further analysis, we discovered that the disabled state color was directly set to light gray.

 

To address this issue, we have made a fix by adding a condition to set the Material 3 design color as per the user-provided color. This ensures that the disabled state color works properly with specific condition to resolve the issue.

 

Regards,

Kamalesh P



Attachment: Syncfusion.Maui.Buttons.25.1.35_ef44cde6.zip


RU Ruud March 27, 2024 08:12 PM UTC

Thank you and I can confirm the custom patch has solved the issue.


Ruud



BV Brundha Velusamy Syncfusion Team April 2, 2024 08:21 AM UTC

Hi Ruud,

 

We have included the fix for the reported issue "Initial button background color while disabled not set" in our latest weekly NuGet release v25.1.38 which is available for download (NuGet). We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you require any further assistance.

 

Note: When customizing the VSM at the sample level for SfButton, ensure to configure the all (Normal, Disabled, and Pressed) states according to your requirements.

 

Regards,

Brundha V


Loader.
Up arrow icon