maui: Setting CollectionView.SelectedItem = null does nothing

Description

I have a simple collection view that is bound to a VM and I am trying to set (unset actually) the SelectedItem to null.

I tried setting the bound property on the VM and the actual vc.SlectedItem = null but it remains selected.

I tried setting the SelectionMode to None, and this causes the property to now return null, but setting it back to Single causes it to “reselect”.

Steps to Reproduce

TODO

Link to public reproduction project repository

TODO

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows, I was not able test on other platforms

Affected platform versions

All

Did you find any workaround?

No response

Relevant log output

No response

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 8
  • Comments: 19 (9 by maintainers)

Most upvoted comments

Using a delay, the selection is deselected, allowing you to select the same item from the list.

  await Task.Delay(100);
  folderCollectionView.SelectedItem = null;

Verified this issue with Visual Studio Enterprise 17.9.0 Preview 2. Can repro this issue.