Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

ListView: Prevent unregisterItem method to delete item from listView #62

Merged
merged 3 commits into from
Aug 16, 2014

Conversation

canthefason
Copy link
Contributor

When I delete an item from listView, two deletion operation was occurring as: one under listViewController->unregisterItem, the other one in listView->removeItem

Not sure if it is ok to remove this line from listViewController, but again as a counterpart, i expect registerItem to add item to listView, but it is not.

Also i did not see any other add/remove operator in listViewController, so I deleted it with the tests. :)

@sinan
Copy link
Member

sinan commented Aug 14, 2014

@usirin made a refactor to this lately, umut can you take a look at this please?

@@ -191,7 +191,6 @@ module.exports = class KDListViewController extends KDViewController
@emit 'UnregisteringItem', itemInstance, index
actualIndex = @getIndex index

@getListItems().splice actualIndex, 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the actualIndex variable as well. Other than tat, LGTM.

szkl pushed a commit that referenced this pull request Aug 16, 2014
ListView: Prevent unregisterItem method to delete item from listView
@szkl szkl merged commit e2a507d into master.listview Aug 16, 2014
@szkl szkl deleted the master.listView.removeItemFix branch August 16, 2014 02:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants