Skip to content

Commit 806cc8a

Browse files
committed
fixup! feat(dropzone): enable multiple file uploads
1 parent 24449f1 commit 806cc8a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/Dropzone/Resources/assets/dist/controller.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class default_1 extends Controller {
2424
if (typeof file === 'undefined') {
2525
return;
2626
}
27-
this.inputTarget.style.display = 'none';
2827
this.placeholderTarget.style.display = 'none';
2928
this.previewFilenameTarget.textContent = file.name;
3029
this.previewTarget.style.display = 'flex';
@@ -50,6 +49,9 @@ class default_1 extends Controller {
5049
this.element.dispatchEvent(new CustomEvent(name, { detail: payload }));
5150
}
5251
}
52+
default_1.values = {
53+
numberOfFiles: Number
54+
};
5355
default_1.targets = ['input', 'placeholder', 'preview', 'previewClearButton', 'previewFilename', 'previewImage'];
5456

5557
export { default_1 as default };

src/Dropzone/Resources/assets/src/controller.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
import { Controller } from '@hotwired/stimulus';
1313

1414
export default class extends Controller {
15+
static values = {
16+
numberOfFiles: Number
17+
}
18+
19+
readonly numberOfFilesValue: number;
20+
1521
readonly inputTarget: HTMLInputElement;
1622
readonly placeholderTarget: HTMLDivElement;
1723
readonly previewTarget: HTMLDivElement;
@@ -55,7 +61,7 @@ export default class extends Controller {
5561
}
5662

5763
// Hide the input and placeholder
58-
this.inputTarget.style.display = 'none';
64+
//this.inputTarget.style.display = 'none'; // hide only, when max number is reached
5965
this.placeholderTarget.style.display = 'none';
6066

6167
// Show the filename in preview

0 commit comments

Comments
 (0)