xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[Bug] ListViewRenderer item tap issue #7490

Open AntonChekalin opened 5 years ago

AntonChekalin commented 5 years ago

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

TestApp.zip

samhouts commented 5 years ago

@AntonChekalin Please use the complete issue template! Can you please attach a small project that demonstrates this issue? Thanks!

AntonChekalin commented 5 years ago

@samhouts yes, I add simple pro to the main comment. Tale a look, please