You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this is a bit of a convoluted one, but the gist of it is the following:
If you have an ItemsRepater contained within a ScrollViewer, with enough items in the repeater that the ScrollViewer can be scrolled. If you then modify the Visibility of the items, you can end up with items being offset outside the visible area of the ItemsRepeater/ScrollViewer
As an example
This is how things should work:
Clicking the respective buttons modifies the Visibility of the items in the ItemsRepeater.
However, if you have scrolled a little and try to do the same, then this will happen:
Now the orangutang appears to be gone, but it is only offset:
The blue square under ItemsRepeater is the actual Item. So it is there, and seemingly Visible, but offset so far that it cannot be seen.
It seems this will only happen when collapsing the later items in the collection. Also if there are so many items being made visible that the ScrollViewer can scroll then this will happen:
Here the first item is offset at first, but once we scroll it snaps back into the correct position.
Steps to reproduce the bug
Created an empty project, and added a page that I navigate to from the MainWindow.
The rest is pretty straight forward. The important bits is to have an ItemsRepeater with enough items that the ScrollViewer Containing it will be activated. And then a way to modify visibility.
Here's the code I had for page I used to make the images with:
Describe the bug
So this is a bit of a convoluted one, but the gist of it is the following:
If you have an ItemsRepater contained within a ScrollViewer, with enough items in the repeater that the ScrollViewer can be scrolled. If you then modify the Visibility of the items, you can end up with items being offset outside the visible area of the ItemsRepeater/ScrollViewer
As an example
![itemsrepeater_item_offset_issue_1](https://private-user-images.githubusercontent.com/1870870/344136373-ae85cb6e-d7e9-4b71-b407-53d84e35c74f.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4MTgzMjcsIm5iZiI6MTcxOTgxODAyNywicGF0aCI6Ii8xODcwODcwLzM0NDEzNjM3My1hZTg1Y2I2ZS1kN2U5LTRiNzEtYjQwNy01M2Q4NGUzNWM3NGYuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDFUMDcxMzQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjhkNzA1OGE3N2JkYWUxZjNmYjhhNGM2NjNkODA1YzhmOThjZjM2MzI2YmM2NWY0NzZkYmYzNTkyY2ZmOWU4ZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.6cAY7N8OHBycYldsHHPYVgR3bn9tETSQRM4PFLTyDc4)
This is how things should work:
Clicking the respective buttons modifies the Visibility of the items in the ItemsRepeater.
However, if you have scrolled a little and try to do the same, then this will happen:
Now the orangutang appears to be gone, but it is only offset:
![image](https://private-user-images.githubusercontent.com/1870870/344137319-cc132768-682a-4e21-8b76-8e4531c5b9ba.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4MTgzMjcsIm5iZiI6MTcxOTgxODAyNywicGF0aCI6Ii8xODcwODcwLzM0NDEzNzMxOS1jYzEzMjc2OC02ODJhLTRlMjEtOGI3Ni04ZTQ1MzFjNWI5YmEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDFUMDcxMzQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzUyNjg5M2U1MjhjOTQ4NzY2NjlhMTZiYTk2ODMzYzg3NDczZDg0OWZiNmNkMGZiOTlkZTk4Y2RjZTgxMDUwNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.prTP5Xihkgs9u6-7DBL-2_-uE9TAShb8br2TKRDGxCs)
The blue square under ItemsRepeater is the actual Item. So it is there, and seemingly Visible, but offset so far that it cannot be seen.
It seems this will only happen when collapsing the later items in the collection. Also if there are so many items being made visible that the ScrollViewer can scroll then this will happen:
![itemsrepeater_item_offset_issue_3](https://private-user-images.githubusercontent.com/1870870/344140089-43d2e289-9ab3-40d2-bcc6-b9f2f529660e.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4MTgzMjcsIm5iZiI6MTcxOTgxODAyNywicGF0aCI6Ii8xODcwODcwLzM0NDE0MDA4OS00M2QyZTI4OS05YWIzLTQwZDItYmNjNi1iOWYyZjUyOTY2MGUuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDFUMDcxMzQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NGExMmFhMmRmMDA5ZDg0ZjNhMzBlNjg3MTczOGQ5ZTNiODQ2MDUyOGQ2ZmFmZWNlNmM3NGJiZWQ0ODkyNmE4NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.GJ0ESaGZYk-C74kEKgrcFZ-cRk0b5IGG5qKuU-fFdKw)
Here the first item is offset at first, but once we scroll it snaps back into the correct position.
Steps to reproduce the bug
Here's the code I had for page I used to make the images with:
MainPage.idl
MainPage.xaml
MainPage.xaml.h
MainPage.xaml.cpp
Expected behavior
The Item not to be offset out of view.
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.5.4: 1.5.240607001
Windows version
Windows 11 (22H2): Build 22621
Additional context
No response
The text was updated successfully, but these errors were encountered: