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
When the ListBox.SelectionMode is set to AlwaysSelected and you attempt to remove the first selected ListBoxItem while it is not visible, the item that gets removed is actually the next ListBoxItem. As a result, the first ListBoxItem stays selected.
To Reproduce
Set SelectionMode of ListBox to AlwaysSelected. First ListBoxItem should be selected when the app is running.
Scroll to the bottom of ListBox (so first ListBoxItem is not visible)
Remove first ListBoxItem
Scroll back to the top of ListBox
It will show that it's the second ListBoxItem that was removed instead of first, and first ListBoxItem is still selected.
###
Expected behavior
When first ListBoxItem is removed, it should be removed in the ListBox, and the second ListBoxItem should be the new SelectedItem
Describe the bug
When the
ListBox.SelectionMode
is set toAlwaysSelected
and you attempt to remove the first selectedListBoxItem
while it is not visible, the item that gets removed is actually the nextListBoxItem
. As a result, the firstListBoxItem
stays selected.To Reproduce
SelectionMode
ofListBox
toAlwaysSelected
. FirstListBoxItem
should be selected when the app is running.ListBox
(so firstListBoxItem
is not visible)ListBoxItem
ListBox
ListBoxItem
that was removed instead of first, and firstListBoxItem
is still selected.Expected behavior
When first
![Kapture 2024-06-29 at 20 56 26](https://private-user-images.githubusercontent.com/23254953/344393977-d00c2865-5f74-45ae-980d-2295dba7ee13.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1MjcxOTAsIm5iZiI6MTcyMDUyNjg5MCwicGF0aCI6Ii8yMzI1NDk1My8zNDQzOTM5NzctZDAwYzI4NjUtNWY3NC00NWFlLTk4MGQtMjI5NWRiYTdlZTEzLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA5VDEyMDgxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVjYmMwYzZhNWYyYmVkZWJiM2YwMTRjMGQyMjViMjBmYmVkZmNlYjdlYmZhMjM5OTZlZDdkMzNmNzY2ZmQ0MjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.CyAEOhWtz4bBU5URD0eQZV5370S3D5RI1M0Xa1ITDN0)
ListBoxItem
is removed, it should be removed in theListBox
, and the secondListBoxItem
should be the newSelectedItem
Avalonia version
11.0.11
OS
macOS
Additional context
You can find the test code here
The text was updated successfully, but these errors were encountered: