-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix Slider thumb not visible when Value is at maximum
There was a bug occurring on iOS where the indicator Rectangle was having its size set from within SizeChanged before the Thumb had a chance to be arranged, leaving it to take the entire space and leave none for the Thumb. As a workaround, return the Width/Height if ActualWidth/ActualHeight haven't been set yet.
- Loading branch information
1 parent
38fec06
commit b9d0083
Showing
2 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_Slider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using static Private.Infrastructure.TestServices; | ||
#if NETFX_CORE | ||
using Uno.UI.Extensions; | ||
#elif __IOS__ | ||
using UIKit; | ||
#elif __MACOS__ | ||
using AppKit; | ||
#else | ||
using Uno.UI; | ||
#endif | ||
|
||
namespace Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls | ||
{ | ||
[TestClass] | ||
[RunsOnUIThread] | ||
public class Given_Slider | ||
{ | ||
[TestMethod] | ||
public async Task When_Value_At_Maximum() | ||
{ | ||
var slider = new Slider { Minimum = 0, Maximum = 100, Value = 100, Orientation = Orientation.Horizontal, Width = 320, VerticalAlignment = VerticalAlignment.Stretch }; | ||
WindowHelper.WindowContent = slider; | ||
|
||
await WindowHelper.WaitForIdle(); | ||
|
||
var thumb = slider.FindFirstChild<Thumb>(); | ||
|
||
Assert.IsNotNull(thumb); | ||
|
||
Assert.IsTrue(thumb.ActualWidth > 0); | ||
Assert.IsTrue(thumb.ActualHeight > 0); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters