Skip to content

[bug] Multidrag select with SHIFT doesn't respect filtered items #1897

@igorlvicente

Description

@igorlvicente

Describe the bug

When I am using multidrag, I select an item, hold shift while selecting another item and all the items between these 2 will be selected too.

I have a list with draggable items on it. Some of these items are filtered out by the filter property on the Sortable configuration.

If one of these filtered items are between the 2 selected items (while holding SHIFT), I can select and sort it.

To Reproduce
Steps to reproduce the behavior:

  1. Select an item before a filtered item
  2. Hold SHIFT and select a item after a filtered item
  3. The filtered item will be selected
  4. Drag all the items and the filtered item will be dragged too

Expected behavior

The filtered items shouldn't be selected.

Information

I think the codesandbox will be enough to understand the bug.
Inside it there will be 4 items. Item "three" is filtered out and you can't move it (unless you are using the bug described here).

Versions
sortablejs = 1.10.2
@types/sortablejs = 1.10.4

Additional context
Add any other context about the problem here.

Reproduction
codesandbox: https://codesandbox.io/s/bug-report-on-sortable-9s6wc?file=/src/index.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions