Skip to content

Flex-end breaks dragging to parent element #1942

@jjeff

Description

@jjeff

Reproduction

https://codepen.io/jjeff/pen/PozoJVQ

Sortablejs-flex-end-bug 2020-10-07 14_32_41

Scenario

SortableJS's normal behavior allows user to drag anywhere onto a Sortable list (including onto the draggable child elements) to add an element to it. However, with justify-content: flex-end; enabled on the parent Sortable element, you can no longer drag into the parent element. Dragging onto the child elements still works, but not onto the Sortable-enabled element itself.

See attached GIF and code at https://codepen.io/jjeff/pen/PozoJVQ. I can reproduce at Codesandbox if needed.

Steps to Reproduce

Summary of steps if applicable.

  1. Add the following CSS targeting a series of lists in the same group:
  display: flex;
  justify-content: flex-end;

Describe the bug

Draggable child elements cannot be dragged to the parent Sortable element itself. Note that other justify-content values such as start, center, and space-around work fine.

Expected behavior

Dragging to parent should add dragged item as a child - preferably on the same end of the child list as the item was dragged.

Version

package version
sortablejs ^1.10.2-?
@types/sortablejs ^x.x.x-? || N/A

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions