Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flex-end breaks dragging to parent element #1942

Closed
jjeff opened this issue Oct 7, 2020 · 4 comments
Closed

Flex-end breaks dragging to parent element #1942

jjeff opened this issue Oct 7, 2020 · 4 comments

Comments

@jjeff
Copy link

jjeff commented Oct 7, 2020

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

@jjeff
Copy link
Author

jjeff commented Nov 19, 2020

I've posted a bug bounty on this one, in case anyone wants some incentive to fix or help with a suitable work-around.

https://www.bountysource.com/issues/93646441-flex-end-breaks-dragging-to-parent-element

@ChaituVR
Copy link

Hi @jjeff, it is not a CSS related issue, sortable JS is not accepting items to droped before first element.. raised a pr, hopefully it will be merged soon

https://codepen.io/ChaituVR/pen/wvWbMXB?editors=0111

@jjeff
Copy link
Author

jjeff commented Nov 19, 2020

Great! Thank you so much!

owen-m1 added a commit that referenced this issue May 2, 2021
@owen-m1
Copy link
Member

owen-m1 commented May 2, 2021

Fixed in commit 77e0481

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants