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.

Is it possible to make the whole Drag n Drop clickable, instead of just the browse text?

See original GitHub issue

I want to customize the drag and drop area in Uppy to look something like this:

drag_and_drop_example

There’s two issues with this currently:

  1. I need to add in the icon and add in the custom text through multiple div as there’s multiple lines of text of varying styles. I can’t implement that by changing the locale string. So my (hacky) solution to this is to add all this HTML through DOM manipulation by adding in some new divs positioned absolutely over the div. This feels wrong to do with React, so even though this issue doesn’t relate to this, I’m open to another suggestion here haha.

  2. I want the “Browse Files” button to be “fake” in the sense that if the user clicks anywhere in the dashed area the system file browser will pop up. I can change the text for this using the dropPaste but I unfortunately can’t set the clickable field.

Does anyone knows how to change the whole drag and drop area to be clickable? I’d be willing to look into creating a custom plugin to do this, but creating a custom plugin appears to be more for adding a new UI element rather than customizing what’s already available.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
arturicommented, Jul 5, 2019

We’d love to be able to use the Dashboard inline but have the whole body as the Drop zone. Will this be possible with the DropPasteTarget plugin?

That is our intention for that plugin, yes.

2reactions
arturicommented, May 29, 2019

Hi! We are considering making the whole DragDrop area clickable, although that would prevent us from adding “paste file” capabilities to DragDrop.

As for customizing the look of DragDrop beyond CSS, yeah, forking it and creating your own version of a plugin would be the way to go. I’d wait a bit with that, since there’s a PR open that refactors how DragDrop works internally a bit: https://github.com/transloadit/uppy/pull/1565

Read more comments on GitHub >

github_iconTop Results From Across the Web

Precise Drag and Drop within a contenteditable - Stack Overflow
The user needs to be able to click and drag the image (fancy box and all) to place it anywhere that they please...
Read more >
Drag'n'Drop with mouse events - The Modern JavaScript Tutorial
Drag 'n'Drop is a great interface solution. Taking something and dragging and dropping it is a clear and simple way to do many...
Read more >
How To Make A Drag-and-Drop File Uploader With Vanilla ...
Technically, this was already possible because most (if not all) implementations of the file selection input allowed you to drag files over it ......
Read more >
How To Create Drag and Drop Elements with Vanilla ...
In this tutorial, we will build a drag-and-drop example using the HTML Drag and Drop API with vanilla JavaScript to use the event...
Read more >
How to differentiate mouse “click” and “drag” event using ...
The JavaScript events ondrag and onclick help us achieve the desired result. When the element is clicked, a click message is displayed just...
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