question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Official Support for Drag and Drop

See original GitHub issue

Is your feature request related to a problem? Please describe.

Some of the most useful and complex Quasar components are difficult to implement with a drag and drop library. See qTable and qTree.

For example If I wanted to implement drag and drop within qTree with this library https://github.com/SortableJS/Vue.Draggable/blob/master/example/components/nested-example.vue I would need to wrap q-tree__node within <draggable>. I have no easy way of doing that.

Describe the solution you’d like

Official support and guidance for a Drag and Drop library which supports mobiles and tablets. It would mean that components structured in such a way that a well known drag and drop library such as the above could easily be implemented.

Examples in the different components docs how the supported library could be used.

I don’t need support for multiple libraries but only one.

Describe alternatives you’ve considered Several drag and drop libraries.I have also rebuilt (bodged) both qTable as well as qTree (just finishing) because of this. Recreating those components is a lot of soul destroying work just to get drag and drop working.

As you can guess I am not the only one to do this see forum posts: https://forum.quasar-framework.org/topic/3543/drag-and-drop https://forum.quasar-framework.org/topic/4010/drag-and-drop-in-qtable-did-anyone-succeed https://forum.quasar-framework.org/topic/4595/q-table-rows-drag-and-drop https://forum.quasar-framework.org/topic/2619/drag-and-drop-data-table-column-ordering https://forum.quasar-framework.org/topic/3069/q-list-sortable/2 and more … I won’t list all here. But it is not difficult to see that a lot of people will want drag and drop and will be implementing (most likely badly) their own solutions.

This is one of the most missed features in Quasar IMO. So hopefully you consider it. Thank you for the great work.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:57
  • Comments:30 (15 by maintainers)

github_iconTop GitHub Comments

10reactions
pdanpdancommented, Jan 22, 2021

Sorry. Please use one of the many available DnD solutions.

6reactions
radiantonecommented, Mar 9, 2020

I vote for a generic drag and drop system where any element can be decorated with drag or drop classes that are managed behind the scenes. The element data is thus passed to handlers for drag and drop listeners on the respective targets. It would be fairly simple system and require no modifications to existing components really, just special decorators that handle style updates to drag and drop targets, which can be handled separately.

for example: Here we declare a drag listener that wraps around a set of elements giving them scope for drag life cycle events for a specific model (e.g. iconDrag). A custom class icon-drag will handle any specific style decorations for that element type. Others can be written or users write their own.

<q-drag-listener v-model="iconDrag">
<q-icon class="drag-source icon-drag" v-model="iconDrag" icon="myiconclass"/>
</q-drag-listener>

Below we decorate a q-tab-panel with drop-target which handles style updates for drag lifecycle events triggered by iconDrag model. The model handles the state and notification to both sides (source and target). icon-drag and panel-drop classes listen for events and update styles accordingly.

<q-drop-listener v-model="iconDrag">
<q-tab-panel class="drop-target panel-drop" v-model="iconDrag" />
</q-drop-listener>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Drag and Drop | Can I use... Support tables for HTML5, CSS3 ...
Drag and Drop ... Method of easily dragging and dropping elements on a page, requiring minimal JavaScript. Usage % of. all users, all...
Read more >
Drag and drop - Android Developers
With drag and drop, users can copy or move text, images, objects—any content that can be represented by a URI—from one View to...
Read more >
Drag and drop - Windows apps | Microsoft Learn
Drag and drop is an intuitive way to transfer data within an application or between applications on the Windows desktop. Drag and drop...
Read more >
How to drag and drop in Split View on iPad | Apple Support
Jennifer at Apple has this useful tip to share on how to drag and drop items between supported apps while in Split View...
Read more >
HTML Drag and Drop API - MDN Web Docs
This overview of HTML Drag and Drop includes a description of the interfaces, basic steps to add drag-and-drop support to an application, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found