diff --git a/src/Uno.UI.RuntimeTests/MUX/Microsoft_UI_Xaml_Controls/SplitButton/SplitButtonTests_InteractionTests.cs b/src/Uno.UI.RuntimeTests/MUX/Microsoft_UI_Xaml_Controls/SplitButton/SplitButtonTests_InteractionTests.cs index 40d12f979679..fddb76a3891b 100644 --- a/src/Uno.UI.RuntimeTests/MUX/Microsoft_UI_Xaml_Controls/SplitButton/SplitButtonTests_InteractionTests.cs +++ b/src/Uno.UI.RuntimeTests/MUX/Microsoft_UI_Xaml_Controls/SplitButton/SplitButtonTests_InteractionTests.cs @@ -154,18 +154,20 @@ public async Task TouchTest() Verify.AreEqual("0", clickCountTextBlock.Text); Verify.AreEqual("0", flyoutOpenedCountTextBlock.Text); - Log.Comment("Click primary button to open flyout in touch mode"); + Log.Comment("Click primary button in touch mode"); // ClickPrimaryButton(splitButton); await ClickPrimaryButton(splitButton, finger); await WindowHelper.WaitForIdle(); - // Uno TODO: the test outputs 1 and 0 instead of 1 and 0 - // This works correctly when manually testing by hand, but fails in the runtime tests. - // Verify.AreEqual("0", clickCountTextBlock.Text); - // Verify.AreEqual("1", flyoutOpenedCountTextBlock.Text); Verify.AreEqual("1", clickCountTextBlock.Text); Verify.AreEqual("0", flyoutOpenedCountTextBlock.Text); + Log.Comment("Click secondary button in touch mode"); + await ClickSecondaryButton(splitButton, finger); + + Verify.AreEqual("1", clickCountTextBlock.Text); + Verify.AreEqual("1", flyoutOpenedCountTextBlock.Text); + Log.Comment("Close flyout by clicking over the button"); // splitButton.Click(); await ClickPrimaryButton(splitButton, finger); diff --git a/src/Uno.UI/Microsoft/UI/Xaml/Controls/SplitButton/SplitButton.cs b/src/Uno.UI/Microsoft/UI/Xaml/Controls/SplitButton/SplitButton.cs index 4e9db6bcdf06..d9f166129b5f 100644 --- a/src/Uno.UI/Microsoft/UI/Xaml/Controls/SplitButton/SplitButton.cs +++ b/src/Uno.UI/Microsoft/UI/Xaml/Controls/SplitButton/SplitButton.cs @@ -209,7 +209,7 @@ private void OnVisualPropertyChanged(DependencyObject sender, DependencyProperty internal void UpdateVisualStates(bool useTransitions = true) { // place the secondary button - if (m_lastPointerDeviceType == PointerDeviceType.Touch || m_isKeyDown) + if (m_isKeyDown) { VisualStateManager.GoToState(this, "SecondaryButtonSpan", useTransitions); }