Skip to content

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

Open
alexshikov wants to merge 1 commit into
migueldeicaza:masterfrom
alexshikov:master
Open

[Fix] Element.IndexPath is null after search was activated.#168
alexshikov wants to merge 1 commit into
migueldeicaza:masterfrom
alexshikov:master

Conversation

@alexshikov

Copy link
Copy Markdown

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

DemoColoredList added to test the issue:

  • CustomElement uses IndexPath to change background color.

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

@migueldeicaza

Copy link
Copy Markdown
Owner

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

Copy link
Copy Markdown
Author

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:

  • 29th line of DemoColoredList.cs is using IndexPath to set color of the cell.

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 : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants