-
Notifications
You must be signed in to change notification settings - Fork 91
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
The ListView Extensions, SmoothScrollIntoView, should have options that only centers vertically or horizontally #647
Comments
Added CenterHorizontally and CenterVertically Fixes this issue: CommunityToolkit#647
We should add this to another type of template, but it'd be good to discuss at a high level more about the suggested changes to the API like this: ```diff Which gets nicely rendered like this: public class Hello1
{
public static void Main()
{
- System.Console.WriteLine("Hello, World!");
+ System.Console.WriteLine("Rock all night long!");
}
} It'd be nice if we can consolidate some of the underlying code across new functions and the existing one. But we may need separate enums for them all for the configuration? I think ultimately, there's 9 different ways to pin the viewport to a corner/edge/center of the rect, right? But if we had Horizontal/VerticalAlignment with 3 options that gets us all the combinations, for instance, I think. |
I should do the Yes there can be more improvements but you wrote in the PR notes that we should only fix 1 issue at a time. I followed the same coding style, comments etc. just like the rest of the code. |
Describe the bug
When we use the SmoothScrollIntoView feature in the ListView Extensions on a ListView like this
On a ListView with over 20 columns and 100k rows, it centers the selected row both vertically and horizontally, which is problematic and undesired because the user needs to scroll back horizontally all the way to the left side again.
There needs to be 2 more separate options such as
CenterVertically
andCenterHorizontally
.The code responsible for it is located here:
https://github.com/CommunityToolkit/Windows/blob/e2eb2c7b5dcc55e0a0f1923a4f4ea45f49a4fb77/components/Extensions/src/ListViewBase/ListViewExtensions.SmoothScrollIntoView.cs#L149C16-L154C27
Steps to reproduce
Expected behavior
Only center vertically.
Screenshots
No response
Code Platform
Windows Build Number
Other Windows Build number
Windows 11 26120.3291
App minimum and target SDK version
Other SDK version
No response
Visual Studio Version
Preview
Visual Studio Build Number
Version 17.14.0 Preview 1.1
Device form factor
Desktop
Additional context
No response
Help us help you
Yes, but if others can assist.
The text was updated successfully, but these errors were encountered: