Skip to content
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

ObservableCollection Selection Lost When Moving a Selected Item in ListBox #17819

Open
vikas1705 opened this issue Dec 23, 2024 · 0 comments
Open
Labels

Comments

@vikas1705
Copy link

vikas1705 commented Dec 23, 2024

Describe the bug

In a ListBox bound to an ObservableCollection, if the position of a selected item is changed, the selection is lost.

The selected item should remain selected even after its position is changed. This issue has been present since release 11.0.13 and persists in subsequent versions.
A Sample project is attached. We are using VS2022
SampleObservableCollection.zip

To Reproduce

  1. Run the sample project.
  2. Select an item in the ListBox.
  3. Click the Update Row button located at the bottom of the ListBox.
  4. The selected item will move to the top, but its selection will be cleared.

Expected behavior

On moving selected item on the top of the list, it should remain selected.

Avalonia version

11.1.0 and onwards

OS

Windows

Additional context

No response

@vikas1705 vikas1705 added the bug label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant