Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Finish ScrollTo implementations for CollectionView on UWP #7509

Merged
merged 3 commits into from
Sep 20, 2019

Conversation

hartez
Copy link
Contributor

@hartez hartez commented Sep 13, 2019

Description of Change

Implements missing ScrollTo features for CollectionView on UWP.

Issues Resolved

API Changes

None

Platforms Affected

  • UWP

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

In Control Gallery, navigate to CollectionView Gallery -> ScrollTo Gallery and run everything.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)
  • Tabs converted to spaces


static bool IsVertical(ScrollViewer scrollViewer)
{
return scrollViewer.HorizontalScrollMode == ScrollMode.Disabled;
Copy link
Member

Choose a reason for hiding this comment

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

Note entirely up-to-date with UWP but is this enough to determine with certainty that it's vertical? There is also a VerticalScrollMode, don't we need to use that or at least get that into the equation?

Copy link
Member

@jfversluis jfversluis left a comment

Choose a reason for hiding this comment

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

Code looks good, but:

  • Build failing on failing unit test? Seems unrelated but weird that it suddenly decides to fail
  • Having a quick play with it I found a NRE in the Gallery app.
    • Go to the CollectionView -> ScrollTo gallery -> ScrollTo Index (Code, Horizontal List) which is the first option
    • Input 42 in Scroll To Index box and click Go
    • Now click Advance (nothing happens, although the index in the middle updates)
    • Keep clicking Advance until you go past the number of items in the collection and watch the fireworks

Same thing happens on the Vertical list and grid and... which might not be surprising

@hartez
Copy link
Contributor Author

hartez commented Sep 17, 2019

  • Build failing on failing unit test? Seems unrelated but weird that it suddenly decides to fail

Rebased on Shane's fixes to the unit tests, should be working now.

  • Go to the CollectionView -> ScrollTo gallery -> ScrollTo Index (Code, Horizontal List) which is the first option
  • Input 42 in Scroll To Index box and click Go
  • Now click Advance (nothing happens, although the index in the middle updates)

Nothing should happen, if the ScrollToPosition is set to MakeVisible, because the next items are already visible.

  • Keep clicking Advance until you go past the number of items in the collection and watch the fireworks

Yep, IndexOutOfRange issue. Should be fixed now.

Copy link
Member

@jfversluis jfversluis left a comment

Choose a reason for hiding this comment

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

Looks all good now! Just a little conflict that needs resolving :)

@rmarinho rmarinho merged commit d2beb36 into 4.3.0 Sep 20, 2019
@samhouts samhouts added this to the 4.3.0 milestone Oct 1, 2019
felipebaltazar pushed a commit to felipebaltazar/Xamarin.Forms that referenced this pull request Oct 16, 2019
…) partially implements xamarin#3172

* Finish ScrollTo implementations for CollectionView on UWP

* Fix NRE when attempting to scroll to index greater than source length
felipebaltazar pushed a commit to felipebaltazar/Xamarin.Forms that referenced this pull request Oct 16, 2019
…) partially implements xamarin#3172

* Finish ScrollTo implementations for CollectionView on UWP

* Fix NRE when attempting to scroll to index greater than source length
@hartez hartez deleted the cv-uwp-scrollto branch October 23, 2019 14:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants