Skip to content

Conversation

@ajpinedam
Copy link
Contributor

GitHub Issue: closes #22287

PR Type:

  • 🐞 Bugfix

What is the current behavior? 🤔

What is the new behavior? 🚀

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes an issue with TimePicker's period (AM/PM) section selection by modifying the inertia handling logic in ScrollContentPresenter. The fix ensures that scroll inertia is properly handled when snap points are configured, even when there is limited or no scrollable space.

Changes:

  • Reorganized the OnInertiaStarting method to check for scroll inertia enablement earlier
  • Added a local function hasValidSnapPoints to determine if snap points are configured for the scroll direction
  • Modified the condition logic to allow inertia handling when either scrollable space exists OR snap points are configured

Comment on lines +478 to +491
// Check if we have snap points configured - if so, we should handle inertia even with limited scrollable space
bool hasValidSnapPoints(ScrollDirection dir)
{
if (dir.HasFlag(ScrollDirection.Left) || dir.HasFlag(ScrollDirection.Right))
{
return sv.HorizontalSnapPointsType is not SnapPointsType.None;
}
if (dir.HasFlag(ScrollDirection.Up) || dir.HasFlag(ScrollDirection.Down))
{
return sv.VerticalSnapPointsType is not SnapPointsType.None;
}

return false;
}
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behavior introduced by this change for snap points with limited scrollable space should be covered by a runtime test. Consider adding a test that verifies inertia handling when snap points are configured but scrollable space is limited or zero (like the TimePicker AM/PM period selector scenario).

Runtime tests can be added to src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ScrollViewer.cs and executed via the SamplesApp test runner.

Copilot uses AI. Check for mistakes.
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22338/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22338/docs/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Skia] TimePicker Period selection only works when tapping

2 participants