Upon completing the upload, dropzone.js displays checkmark and x icons for confirmation

It seems like there may be a CSS problem. When I programmatically create a dropzone box, I notice that the checkmark and x icons, along with other text, appear after the upload (see image link).

<div id="header-dropzone"></div>
$("#header-dropzone").dropzone({ url: "/header" })

However, when I simply use a form and initialize it with dropzone, the icons do not appear after the upload.

<form action="/header" class="dropzone"></form>

https://i.sstatic.net/jD295.png

I am puzzled as to why the jquery-style method does not hide those icons, especially since they are using the same CSS.

Answer №1

I encountered a bug and have reported it here:

In the meantime, a temporary solution is to manually adjust the appearance by changing the white tick to green and making the white-cross invisible (or vice versa):

theDropzone.on("success", function(file){   
  $(".dz-success-mark svg").css("background", "green");
  $(".dz-error-mark").css("display", "none");
});
theDropzone.on("error", function(file) {
  $(".dz-error-mark svg").css("background", "red");
  $(".dz-success-mark").css("display", "none");
});

Answer №2

Encountered the same problem and found a workaround. I simply included the dropzone class to the element right after setting it up. This bypasses the autoDiscover problem while maintaining the expected check/x behavior.

Check out the code snippet below:

$("#my-dropzone").dropzone({ /* options */ });
$("#my-dropzone").addClass("dropzone");

Answer №3

After encountering a problem, I discovered that the CSS for the library was missing from my document (I had overlooked importing it). Adding the *.css file to my main *.scss file fixed the issue.

(utilizing .NET, node_modules (NPM), and *.scss):

@import "~dropzone/dist/dropzone.css";

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Shuffle the JSON data before displaying it

Just a heads up, the code you're about to see might make you cringe, but I'm doing my best with what I know. I've got a JSON file with a bunch of questions, here's what it looks like: { "questions": [ { "id": 1 ...

Exploring alternatives to setTimeOut() for precise timing of Javascript events, especially when incorporating third party events

Here is the HTML element stack that I am working with: <div class="btn-group btnSortAssType" data-toggle="buttons"> <label class="btn ink-reaction btn-primary active"> <input type="checkbox" value="m">Model </label> ...

The row and col classes will only expand to the full width if they are used within form or p elements

I am facing some unusual behaviors while using Bootstrap in my current project. It seems to be the first time I have encountered such issues. Below is the HTML code snippet: <div class="row" style="background-color: blue; padding: 2rem; ...

Troubleshooting problems with background-image in CSS using Javascript

My latest project involves coding to assign background images to various classes using jQuery. The image files are named in a numerical order, such as 0bg.jpg, 1bg.jpg, 2bg.jpg, and so on. for (i=0; i < 8; i++) { $('.hpCarousel:eq('+i+' ...

Distributing elements evenly across the parent width using Angular FlexLayout for a responsive design

I need to create 3 div squares: div-left, div-middle, and div-right, each with a width of 300px. These squares should be arranged horizontally within the parent div main-section, which will adjust its size based on the screen width, being 1300px if the scr ...

Filtering Completed: Table Returned

Recently, I worked on a fun project where I organized JSON wine data into a table and created an object that defines various wines along with their attributes like color, taste, and body. The main objective: When clicking the red button, I want a function ...

Receiving a Promise<fullfield> as a result

I have a situation where I am adding several promises to an array: const apiCallsToMake = []; apiCallsToMake.push(this.getDataFromUnsplash(copyInputParams)); apiCallsToMake.push(this.getDataFromPexels(copyInputParams)); apiCallsToMake.pu ...

The issue of why padding left is not functioning correctly in Bootstrap version 5.3.1

</head> <body> <header class="bg-info "> <div class="container"> <div class="row text-white"> <div class="col-md-6 p-3 pl-6 "> ...

Preventing pop-up windows from appearing when triggered by a mouse click event

I am looking for a solution to trigger a popup window when a user right-clicks on a specific area. Here is the current code I am using: $("#popup").bind('mousedown', function(e) { var w; if(e.which==3) { w=window.open('link& ...

How can I click the add button to show the information in the input field and display it in a <p> tag that is created using JavaScript? (without using inline JavaScript)

Is there a way to dynamically add user input to the page without using inline JavaScript and with minimal HTML? I want to create a new paragraph element through JavaScript when the user clicks a button, instead of relying on static elements in the HTML. & ...

What is the best way to include interactive text on an image?

Just starting to learn html and could use some quick guidance. I have this image here: https://i.sstatic.net/kBJEk.png I would like to place clickable text on the image that links to different pages when clicked, similar to this example: https://i.sstatic ...

How to update data in AngularJS grid component using ng-bind directive

As a newcomer to AngularJS, I'm facing an issue that I need help with. Here's my problem: I have an ng-grid connected to a table. Inside the grid, there are values along with an ID (which is a foreign key from another table). Instead of display ...

Discover the steps to obtain a READY status for your uploaded video using the Kaltura VPaaS API

After uploading the video, it will show as CONVERTING in the media status on the KMC dashboard. Eventually, it will change to READY. Is there a way for me to verify the status and make sure it is READY? ...

Encountering an error when setting up a React-TypeScript ContextAPI

I am currently attempting to understand and replicate the functionality of a specific package found at: https://github.com/AlexSegen/react-shopping-cart Working within a React-Typescript project, I have encountered challenges when creating the ProductCont ...

Unable to initiate the server generated by the express.js generator

Currently, I am trying to set up an Express.js server using their generator. Following the documentation, I was able to successfully create the basic structure. However, when attempting to run the prescribed command (SET DEBUG=transcriptverificationserver: ...

The server will not accept the 'text/html' content type until it is terminated

I am encountering an issue with serving a simple html page through node. When I specify the content type as text/plain, the plain text of the html file loads correctly. However, when I switch it to "content-type" : "text/html", the browser tab keeps loadi ...

Switch up the component's style based on the route being accessed

Is there a way to dynamically load CSS styles in a component based on URL parameters? The idea is that the user will access the page using a URL structure like SOME_URL/{screenSize}/{type}. While the component remains the same, the CSS styling should chang ...

AddDeviceModalCtrl is not defined as a function, it is showing as undefined

I am encountering the error mentioned above, I suspect that it is due to the controller not being properly attached to the module. However, I could be mistaken. Below is the definition of the controller. (function () { 'use strict'; angular . ...

What is the best way to position the <h:panelGrid> itself at a location other than the center?

Whenever I utilize this code snippet <h:panelGrid id="myGrid" columns="1" rendered="#{myBean.showResults}" width="50%" border="1" style="text-align: center;"> The panelGrid items will be centered HOWEVER, I desire to center the h:panelGrid it ...

AngularJS enables you to easily manipulate image width and height using the ng-file-upload feature

Seeking assistance with validating image width and height based on a 1:3 ratio prior to uploading using ng-file-upload. The validation should occur before sending the image to the server. Unsure how to retrieve the dimensions of the selected image for val ...