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

Question: custom drop area/increasing size of the drop area #327

Open
brunobely opened this issue Nov 10, 2021 · 6 comments
Open

Question: custom drop area/increasing size of the drop area #327

brunobely opened this issue Nov 10, 2021 · 6 comments

Comments

@brunobely
Copy link

I'm not exactly sure how to ask this question so I'll lead with an example of the functionality I'd like to achieve. My use case would ideally behave somewhat like Trello's drag-and-drop for cards. In it, each list on the kanban board only takes up as much space as is needed to fit all cards, up to a maximum of the entire height of the screen.

However, it is possible to move a card to a different column by dragging it to any point in the column under a list (if the list isn't as tall as the height of the screen).

Also, only cards can be dragged/reordered, not the list header and footer. I mention this because I thought of just putting the dnd zone higher up in the hierarchy, but then the header and footer of the list are also subject to drag/reorder.


GIF of behavior I'm trying to recreate:

2021-11-09 19 27 16

@isaacHagoel
Copy link
Owner

Have you looked at this example?
specifically delete line 29 in Board.svelte

@brunobely
Copy link
Author

Yep! That's the main example I was looking at-- what I'm trying to do, though, is (after deleting line 29) allowing the user to drop a card below the column and still have it correctly slot into the column. In the screenshot below, if I dropped item45 exactly where it is, I'd want it to go under "DOING", but it goes back into "TODO":

Screen Shot 2021-11-10 at 9 32 01 PM

@isaacHagoel
Copy link
Owner

isaacHagoel commented Nov 11, 2021 via email

@brunobely
Copy link
Author

Do you know if it's possible to do that while still positioning a button below all the items that sits just below the last item rather than at the very bottom? I think this is the toughest hurdle I'm facing: selectively allowing dragging by item. I think it would be interesting to be able to set one (outer) element as the drag/drop zone and one (inner) element as the container for the draggable items.

@isaacHagoel
Copy link
Owner

isaacHagoel commented Nov 12, 2021 via email

@devghost
Copy link

devghost commented Feb 6, 2023

Did anyone get this to work? Having a similar problem, have a REPL here:
https://svelte.dev/repl/3cdfe2d95519407581d9265fba1f6e42?version=3.55.1

Basically, I'd like to be able to drop a card anywhere in the red area (below the cards), even though the area below the blue area at the bottom is outside of the dnd zone.

Reason for this is from a UX perspective, it'll be way easier for the user to move the card (49 in the example) slightly to the right, and it'll get attached at the bottom of the list. Instead of having to move to the right and then all the way up to the top.

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

No branches or pull requests

3 participants