Setting ListView.SelectedItem from within a cell highlights the cell below the selected one. This only occurs under Android and not UWP.
The correct Item gets set, and if a ViewModel binds on the SelectedItem, the correct Item gets set in the ViewModel. So, this seems to be a purely visual problem, and everything functions as it should in code.
Setting the SelectedItem form within the ViewModel also works without issues.
This first Xamarin.Forms Version with this bug is 5.0.0.2515. Older Versions work correctly.
Steps to Reproduce
Create a ListView with a custom cell.
Set the SelectedItem of the ListView from within the cell, i.e. by using Xamarin.CommunityToolkit.Effects.TouchEffect to implement a PressCommand
Fill the ListView with some entries
The entry below the one set from within the cell will be highlighted
Expected Behavior
The SelectedItem of the ListView should be highlighted
Actual Behavior
The entry below the SelctedItem gets highlighted.
Basic Information
• Version with issue: Xamarin.Forms Version: 5.0.0. 2515, 5.0.0.2545
• Last known good version: 5.0.0.2478
• Platform Target Frameworks:
Android: 13
Description
Setting ListView.SelectedItem from within a cell highlights the cell below the selected one. This only occurs under Android and not UWP. The correct Item gets set, and if a ViewModel binds on the SelectedItem, the correct Item gets set in the ViewModel. So, this seems to be a purely visual problem, and everything functions as it should in code. Setting the SelectedItem form within the ViewModel also works without issues. This first Xamarin.Forms Version with this bug is 5.0.0.2515. Older Versions work correctly.
Steps to Reproduce
Expected Behavior
The SelectedItem of the ListView should be highlighted
Actual Behavior
The entry below the SelctedItem gets highlighted.
Basic Information
• Version with issue: Xamarin.Forms Version: 5.0.0. 2515, 5.0.0.2545 • Last known good version: 5.0.0.2478 • Platform Target Frameworks: Android: 13
Screenshots
Reproduction Link
ListViewBugDemo.zip