CommunityToolkit/WindowsCommunityToolkit

RangeSelector breaking WinUI 3.0 when setting Minimum/Maximum via code to the same value

Open

#4,110 opened on 2021年7月14日

GitHub で見る
 (1 comment) (0 reactions) (0 assignees)C# (5,708 stars) (1,403 forks)batch import
WinUI :diamond_shape_with_a_dot_inside:bug :bug:controls :control_knobs:help wanted

説明

Describe the bug

When programatically setting a RangeSelector's Minimum and Maximum property to the same value, the app's UI breaks and partially doesn't respond to user actions (like hovering over a button). This behaviour was either introduced by Community.Toolkit.WinUI.UI.Controls v7.0.3 (not present in v7.0.2) or Project reunion 0.8.0 (not present in 0.5.6).

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work: 7.0.2

Steps to Reproduce

  • Can this be reproduced in the Sample App? (Either in a sample as-is or with new XAML pasted in the editor.) If so, please provide custom XAML or steps to reproduce. If not, let us know why it can't be reproduced (e.g. more complex setup, environment, dependencies, etc...)

Steps to reproduce the behavior:

  1. Create a new WinUI 3 Desktop app (Project reunion 0.8.1, Community.Toolkit.WinUI.UI.Controls 7.0.3)
  2. Add the following code:
<StackPanel>
    <Button Margin="20" Content="Hello world" />
    <controls:RangeSelector x:Name="rng" Margin="20" HorizontalAlignment="Stretch" />
    <ToggleSwitch Toggled="ToggleSwitch_Toggled" />
</StackPanel>
private void ToggleSwitch_Toggled(object sender, RoutedEventArgs e)
{
    rng.Minimum = 1;
    rng.Maximum = 1;
}

Expected behavior

After toggling the switch, the UI should still work. Instead, the RangeSelector loses its handles and the button doesn't respond to mouse events but needs to be reactivated via the keyboard's Tab.

Screenshots

image

Environment

NuGet Package(s):
CommunityToolkit.WinUI.UI.Controls 7.0.3
Microsoft.ProjectReunion 0.8.1

Package Version(s):

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] May 2020 Update (19041)
- [x] Insider Build (build number: 22000.65)

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763) MIN
- [ ] May 2019 Update (18362)
- [x] May 2020 Update (19041) TARGET
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio
- [ ] 2017 (version: )
- [ ] 2019 (version: )
- [x] 2019 Preview (version: 16.11.0 preview 1.0)

Additional context

コントリビューターガイド