isaacHagoel / svelte-dnd-action

An action based drag and drop container for Svelte
MIT License
1.81k stars 104 forks source link

Q: Vertical positioning for timetable component? #354

Closed vlntsolo closed 1 year ago

vlntsolo commented 2 years ago

Hi! I was looking for a neat Svelte dnd implementation and looks like I found it. Thanks! Just a quick question. My component requires something similar to calendar daily timetable. So I wonder if it's possible to allow absolute positioning inside drop container? So that I could move the div and track its new start and end Y coordinate?

Looped through the issues and found this thread. And it might work. Issue 257

Did I miss something?

isaacHagoel commented 2 years ago

Hi, not sure i fully follow :) can you describe exactly what you are trying to achieve and/or include a REPL that illustrates it? In general, dragging absolutely positioned elements is usually quite easy to implement from scratch (if there is no list re-sorting involved)

vlntsolo commented 2 years ago

Sure, here's the sketch.

In general, dragging absolutely positioned elements is usually quite easy to implement from scratch (if there is no list re-sorting involved) Agree, I just didn't want to reinvent the wheel. Will look into it.

vlntsolo commented 2 years ago

Link to REPL

isaacHagoel commented 2 years ago

thanks. How should absolute positioning come into play?

On Sat, Feb 19, 2022 at 6:48 AM Valentine Solonechnyi < @.***> wrote:

Link to REPL https://svelte.dev/repl/dcc54cb0772f488cb9210b2942ab5e7d?version=3.46.4

— Reply to this email directly, view it on GitHub https://github.com/isaacHagoel/svelte-dnd-action/issues/354#issuecomment-1045086928, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4OZCYCMHKFGRVJ6S4XIN3U32PAXANCNFSM5OV4HIZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

vlntsolo commented 2 years ago

I'd like to disable automatic alignment of the block in the drop zone. So i could drop it anywhere alongside the container. Thus I will have something like Google calendar, to position event on the timeline. Is it possible to tweak it somehow? I've noticed that this solution doesn't play well with mobile screens

isaacHagoel commented 2 years ago

if the REPL from #257 works for you besides the lack of mobile support, this could be fixed quite easily. See the TODOs in the code. It currently doesn't listen on the touch events at all (need to listen on touchmove and maybe touchstart and touchend, notice you need to use e.touches[0] instead of e)

On Sat, Feb 19, 2022 at 9:49 AM Valentine Solonechnyi < @.***> wrote:

I'd like to disable automatic alignment of the block in the drop zone. So i could drop it anywhere alongside the container. Thus I will have something like Google calendar, to position event on the timeline. Is it possible to tweak it somehow? I've noticed that (this solution)[ https://github.com//issues/257 https://github.com/isaacHagoel/svelte-dnd-action/issues/257] doesn't play well with mobile screens

— Reply to this email directly, view it on GitHub https://github.com/isaacHagoel/svelte-dnd-action/issues/354#issuecomment-1045300392, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4OZC5CVT5CV2HIPTXYU43U33EGNANCNFSM5OV4HIZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

vlntsolo commented 2 years ago

Thanks for the hints. I'll share final code once done with modifications.