Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make SplitButton click and tap behave the same #19625

Merged
merged 1 commit into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Loading