keystonejs/keystone-classic

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

开放

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

 (1 条评论) (0 个反应) (0 位负责人)JavaScript (2,288 个派生)batch import
bughelp wanted

仓库指标

星标
 (14,656 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南