xamarin/Xamarin.Forms

[Bug] [iOS] If ListView.BeginRefresh is called from the SearchBar.SearchButtonPressed event handler, top items in the list are hidden by the search bar.

Open

#6,353 opened on May 29, 2019

 (1 comment) (0 reactions) (0 assignees)C# (1,926 forks)batch import
a/listviewe/4 :clock4:help wantedp/iOS 🍎t/bug :bug:up-for-grabs

Repository metrics

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

Description

Description

On iOS, if ListView.BeginRefresh is called from the SearchBar.SearchButtonPressed event handler, the top items in the ListView are hidden when the refresh completes.

This does not happen on Android. There is a similar, but different bug that also occurs only on iOS here: https://github.com/xamarin/Xamarin.Forms/issues/5918 The above bug may be related to this bug.

Steps to Reproduce

  1. Open the attached test project
  2. Run the iOS project to an iOS simulator (tested on a iPhone Xr 12.2 simulator)
  3. Enter some text in the search bar and hit the Search button on the soft keyboard (or Return if using a hardware keyboard)

Expected Behavior

The top two list items, titled Hidden Item 1 and Hidden Item 2 should show at the top of the list.

Actual Behavior

The top two list items, titled Hidden Item 1 and Hidden Item 2 do not show at the top of the list.

Notes

Calling ListView.BeginRefresh from the SearchBar.TextChanged event handler does not cause the issue, nor if calling from a button click event handler. These are implemented in the test project so you can test this yourself.

Slight correction: the issue will occur when ListView.BeginRefresh is called from the SearchBar.TextChanged event handler if the characters are typed in quick succession, but only the top list item is hidden in this case.

Basic Information

  • Version with issue: 4.0.0425677
  • Last known good version: Unknown
  • IDE: VS4M
  • Platform Target Frameworks:
    • iOS: 12.2

Screenshots

ScreenCaptureProject1.mp4.zip

Reproduction Link

SearchBarIssue2.zip

Contributor guide