migueldeicaza / MonoTouch.Dialog

Tools to simplify creating dialogs with the user using MonoTouch
MIT License
430 stars 211 forks source link

[Fix] Element.IndexPath is null after search was activated. #168

Open alexshikov opened 11 years ago

alexshikov commented 11 years ago

Fixed an issue when Element.IndexPath is null after search was activated.

DemoColoredList added to test the issue:

As an option: move parent reassignment logic from DialogViewController to Section.

migueldeicaza commented 11 years ago

I am not sure that I understand this patch, can you tell me how to reproduce the bug, so I can evaluate the patch?

The sample is also wrong, when you subclass an Element, you must provide your own unique Key, otherwise the cells can be mixed up with other cells (likely you wont notice in this sample, but if you mix other stringelements, you would).

alexshikov commented 11 years ago

Steps to reproduce:

  1. Create DVC with SearchBar
  2. Type something in SearchBar
  3. Get IndexPath for any Element

Actual result: IndexPath is null

The provided sample is the test for the bug:

Sorry for incorrect using of unique Key and trash changes in Sample.csproj.

Either I can fix pull-request or you can just close it and make fix in a better way : )