From 7a8cd2a734ef6ad53ee2a575470a52564ccae889 Mon Sep 17 00:00:00 2001 From: Nicolas CARPi Date: Sun, 7 Jul 2024 15:57:04 +0200 Subject: [PATCH] fix bug where using an ID for selecting the dropzone element would make the lib crash. fix #12 --- CHANGELOG.md | 4 ++++ package.json | 2 +- src/dropzone.js | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e5dd4da4..5cd62eb1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 7.1.4 + +Fix bug where using an ID for selecting the dropzone element would make the lib crash. fix #12 + ## 7.1.3 A very small patch release with a fix regarding the `form` attribute of the hidden `input` field. See dropzone/dropzone#2300. PR #11 by @bancer. diff --git a/package.json b/package.json index 8c156fdb2..2aad79a03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@deltablot/dropzone", - "version": "7.1.3", + "version": "7.1.4", "description": "Handles drag and drop of files for you.", "keywords": [ "dragndrop", diff --git a/src/dropzone.js b/src/dropzone.js index 0f6f46a33..55b233e28 100644 --- a/src/dropzone.js +++ b/src/dropzone.js @@ -1717,7 +1717,7 @@ Dropzone.options = {}; // Returns the options for an element or undefined if none available. Dropzone.optionsForElement = function (element) { // Get the `Dropzone.options.elementId` for this element if it exists - if (element.getAttribute("id")) { + if (element.getAttribute("id") && typeof Dropzone.options !== 'undefined') { return Dropzone.options[camelize(element.getAttribute("id"))]; } else { return undefined;