Focused State does not work when Shift by Tab

0 Answers 33 Views
Button
Allen
Top achievements
Rank 1
Iron
Iron
Allen asked on 22 Mar 2022, 03:50 AM | edited on 22 Mar 2022, 03:52 AM

Hey Team,

I have a question about Button Focus state, I do as below steps, after that I found the focus stats does not work any more. 

1. Create Focused state and set Border and TextColor, BorderThickness.

2. Run app on window desktop. When I use tab to shift focus. I found it is work.

3. When I keep Pressing button and mouse move out from button. Then use tab reselect button, you will see it does not work any more. 

4. By the way, if I use WidthRequest and HeightReqyest to modify button size, it doesn't work. you can see my screenshot below.

<telerikInput:RadButton x:Name="button" Grid.Row="2"
                               Text="Click me!"  
                               BackgroundColor="#313131"
                               AutomationId="button"
                               FontAttributes="Bold"
                               HorizontalContentAlignment="Center"
                               VerticalContentAlignment="Center"
                               IsEnabled="{Binding EnableCommand}"
                               Command="{Binding OperationCommand}"
                               Padding="20,20"
                               Clicked="OnButtonClick">
                <!--WidthRequest="200" 
                               HeightRequest="100">-->
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <!-- rest style -->
                        <VisualState x:Name="Normal">
                            <VisualState.Setters>
                                <Setter Property="TextColor" Value="#D2D2D2"/>
                            </VisualState.Setters>
                        </VisualState>
                        <VisualState x:Name="Focused">
                            <VisualState.Setters>
                                <Setter Property="BorderColor" Value="#5CBF4A"/>
                                <Setter Property="TextColor" Value="White"/>
                                <Setter Property="BorderThickness" Value="2"/>
                            </VisualState.Setters>
                        </VisualState>
                        <VisualState x:Name="PointerOver">
                            <VisualState.Setters>
                                <Setter Property="TextColor" Value="Red"/>
                            </VisualState.Setters>
                        </VisualState>
                        <VisualState x:Name="Pressed">
                            <VisualState.Setters>
                                <Setter Property="TextColor" Value="#A0A0A0"/>
                            </VisualState.Setters>
                        </VisualState>
                        <VisualState x:Name="Disabled">
                            <VisualState.Setters>
                                <Setter Property="TextColor" Value="Grey"/>
                            </VisualState.Setters>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
            </telerikInput:RadButton>




    Lance | Manager Technical Support
    Telerik team
    commented on 22 Mar 2022, 02:16 PM

    Hi Allen, can you please try the same experiments with the MAUI Button? The reason I ask this is because it is critical you separate what is the responsibility of the Telerik layer and what is from the MAUI layer.

    The RadButton is a MAUI Button with additional Telerik functionality, we do not change any focus functionality... that comes from Microsoft. so I suspect what you're experiencing also happens with Button and needs to be addressed by the MAUI-WinUI team.

    Notes:

    • Important: There are known issues in preview14 with VisualStateManager, please consult the MAUI GitHub Issues for more information.
    • This could very likely also be a WinUI3 issue, try doing a File > New > WinUI3-Desktop (not UWP) project to eliminate this cause.

    All my tests have found the same behavior between RadButton and Button for all focus, animation and visual state issues. My recommendation is to open a new Issue in GitHub and provide a repro (note: don't use 3rd party controls in example for them or they'll misunderstand and close it immediately).

    No answers yet. Maybe you can help?

    Tags
    Button
    Asked by
    Allen
    Top achievements
    Rank 1
    Iron
    Iron
    Share this question
    or