-
Notifications
You must be signed in to change notification settings - Fork 839
fix(TimePicker): period section selection #22338
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
base: master
Are you sure you want to change the base?
fix(TimePicker): period section selection #22338
Conversation
There was a problem hiding this 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
OnInertiaStartingmethod to check for scroll inertia enablement earlier - Added a local function
hasValidSnapPointsto 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
| // 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; | ||
| } |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
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.
|
🤖 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 |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22338/docs/index.html |
GitHub Issue: closes #22287
PR Type:
What is the current behavior? 🤔
What is the new behavior? 🚀
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️