Port nested ScrollIntoView fix from 4.8 #4994
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses issue #4991
Description
ScrollIntoView relies on a helper method VirtualizingStackPanel.MakeVisiblePhysicalHelper, whose job is
The code for job (2) is totally wrong; it describes the rectangle occupied by the child before scrolling to the new offset (and doesn't even get that right in all cases), rather than the rectangle the child will occupy after scrolling.
The rectangle is only used in the nested-scrolling situation; it's how an inner scroller tells an outer scroller where it should scroll to. This situation has never worked, but apparently no one noticed.
When ScrollUnit="Item", a different helper VSP.MakeVisibleLogicalHelper is used; it does job (2) right.
Customer Impact
unexpected scrolling may induce operation mistakes.
Regression
No
Testing
Ad-hoc around customer scenario.
Standard regression testing.
New test case covering this scenario.
Risk
Low. Port of .NETFx servicing fix released earlier this year.