xamarin/Xamarin.Forms

Entry focus issue inside ListView

Open

#1,600 opened on Jan 18, 2018

View on GitHub
 (34 comments) (0 reactions) (0 assignees)C# (1,926 forks)batch import
a/listviewe/3 :clock3:help wantedm/high impact :black_large_square:p/Androidt/bug :bug:up-for-grabs

Repository metrics

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

Description

Description

There seems to be a bug when using the focus event of an Entry inside a listview. I've created a test app that contains a listview with a datatemplate selector. Some rows will render an Entry that has a focus function, these rows have a blue background. When the Entry is focussed the text is changed to the current datetime. The other rows are normal Entries that do nothing when focussed, these rows have a green background. Focussing the first blue Entry will enter the current datetime in that Entry. Focussing the first green Entry will cause the text of the first blue Entry to be updated continuously, trying to type in the green Entry won't add any text. Focussing any of the other blue Entries will cause the text of that Entry and the text of the first Entry to be updated continuously.

Note: tested on Android version 6.0 and 7.0. Not sure if this occurs on iOS as well. Note: tested with cachingstrategy RetainElement and RecycleElement, results are the same.

Steps to Reproduce

  • Run the test app
  • Tap on first Entry, the current datetime will appear in the Entry
  • Tap on second Entry, the current datetime will be updated in the first Entry continuously
  • Tap the third Entry, the current datetime will be updateed in the first and third Entry continuously

Expected Behavior

Focussing an Entry sets the text to the current date.

Actual Behavior

The text of two entries are updated in an infinite loop.

Basic Information

  • Version with issue: 2.5.0.122203
  • Last known good version: unknown
  • IDE: Visual Studio
  • Platform Target Frameworks:
    • Android: tested on 6.0 and 7.0
  • Android Support Library Version: 25 DataTemplateSelector.zip

Contributor guide