Thanks for your work! I'm trying to use this in a Node environment. But get the error:
"myDirectory\node_modules\file-upload-with-preview\dist\file-upload-with-preview.umd.js:807
if (!Element.prototype.matches) {
^
ReferenceError: Element is not defined "
Here's my HTML.
`
...
<!-- You'll want to make sure to at least set a width on the -->
<!-- .custom-file-container class... -->
...
</head>
<body>
...
<div class="custom-file-container" data-upload-id="myUniqueUploadId">
<label>Upload File <a href="javascript:void(0)" class="custom-file-container__image-clear" title="Clear Image">×</a></label>
<label class="custom-file-container__custom-file" >
<input type="file" class="custom-file-container__custom-file__custom-file-input" accept="*" multiple aria-label="Choose File">
<input type="hidden" name="MAX_FILE_SIZE" value="10485760" />
<span class="custom-file-container__custom-file__custom-file-control"></span>
</label>
<div class="custom-file-container__image-preview"></div>
</div>
...
<script src="https://unpkg.com/[email protected]/dist/file-upload-with-preview.min.js"></script>
<script>
var upload = new FileUploadWithPreview('myUniqueUploadId', {
showDeleteButtonOnImages: true,
text: {
chooseFile: 'Custom Placeholder Copy',
browse: 'Custom Button Copy',
selectedCount: 'Custom Files Selected Copy',
},
images: {
baseImage: importedBaseImage,
},
presetFiles: [
'../public/logo-promosis.png',
'https://images.unsplash.com/photo-1557090495-fc9312e77b28?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=668&q=80',
],
})
</script>
</body>