Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Android ListView SelectedItem highlighting #15647

Closed
ES-2000 opened this issue Jan 4, 2023 · 1 comment · Fixed by #15660
Closed

[Bug] Android ListView SelectedItem highlighting #15647

ES-2000 opened this issue Jan 4, 2023 · 1 comment · Fixed by #15660
Labels
a/listview Problems with the ListView/TableView p/Android s/unverified New report that has yet to be verified t/bug 🐛

Comments

@ES-2000
Copy link

ES-2000 commented Jan 4, 2023

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

  1. Create a ListView with a custom cell.
  2. Set the SelectedItem of the ListView from within the cell, i.e. by using Xamarin.CommunityToolkit.Effects.TouchEffect to implement a PressCommand
  3. Fill the ListView with some entries
  4. 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

Screenshots

ListViewBugScreenshot

Reproduction Link

ListViewBugDemo.zip

@ES-2000 ES-2000 added s/unverified New report that has yet to be verified t/bug 🐛 labels Jan 4, 2023
heikow10 added a commit to heikow10/Xamarin.Forms that referenced this issue Jan 14, 2023
heikow10 added a commit to heikow10/Xamarin.Forms that referenced this issue Jan 14, 2023
@jsuarezruiz jsuarezruiz added p/Android a/listview Problems with the ListView/TableView labels Jan 24, 2023
@stefanomasseroli
Copy link

Same issue here

jfversluis pushed a commit that referenced this issue Nov 9, 2023
* Add repro sample (#15647)

* Fix selecting of an item in an Android ListView (#15647)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/listview Problems with the ListView/TableView p/Android s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@jsuarezruiz @stefanomasseroli @ES-2000 and others