keystonejs/keystone-classic

Drag and drop ordering doesn't work well when filter is applied

Open

#4,384 创建于 2017年7月12日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (14,656 star) (2,288 fork)batch import
bughelp wanted

描述

Expected behavior

When filtering a list, drag and drop re-ordering should place list items in the correct order (within the context of the filtered items).

Actual/Current behavior

When an item is dragged into a new position in the list, it's sortOrder is being set to it's position in the current list (which may not be the correct value when some items have been filtered out).

Steps to reproduce the actual/current behavior

For example, if I'm filtering my list in such a way that shows items with sortOrders of 1,5, 6 and 7, If I drag the fourth item (with sort order of 7) above the third item (with sort order of 6) it's sort order is then updated to '3' (it's position in the current filtered list), meaning that the items now have sort orders on 1, 5, 3 and 7 and have in fact have been put into an incorrect order.

I can see where list.model.reorderItems is being called but I'm having trouble finding where this is defined in order to take a look at this myself.

Environment

Software Version
Keystone 4.0.0-beta.5
Node 6.9.4

贡献者指南