xamarin/Xamarin.Forms

[Bug] ListViewRenderer item tap issue

Open

#7,490 opened on Sep 12, 2019

 (2 comments) (0 reactions) (0 assignees)C# (1,926 forks)batch import
a/listviewe/2 :clock2:help wantedp/Androidt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description

This isuue occurs on Android.

protected override void OnElementChanged(ElementChangedEventArgs<ListView> e) { SetNativeControl(new CustomListView(Context)); base.OnElementChanged(e); }

When Tapped first item - nothing happened at all. When I tapped second item ItemTapHandler get first item. When I tap on third item^ the second item is handled and so on. I try to use android ListView instead of CustomListView, but I got the same behaviour.

Steps to Reproduce

  1. Start project
  2. Tap on first item in the list
  3. Tap on last "Ten" item in the list

Expected Behavior

App write in console: Item name: One, item position: 0 Item name: Ten, item position: 9

Actual Behavior

App write nothing for first tap. App write in console: Item name: Nine, item position: 8

Basic Information

  • Version with issue: Version 8.2.6 (build 26)
  • Last known good version: -
  • IDE: Visual Studio Enterprise 2019 for Mac
  • Platform Target Frameworks: Mono Framework MDK Runtime: Mono 6.0.0.334 (2019-02/6256b82d62f) (64-bit) Package version: 600000334
    • Android: SDK Tools Version: 26.1.1 SDK Platform Tools Version: 29.0.1 SDK Build Tools Version: 28.0.3
  • Nuget Packages: Version: 5.1.0.6013

TestApp.zip

Contributor guide