diff --git a/app/assets/javascripts/polaris_view_components.js b/app/assets/javascripts/polaris_view_components.js index 9b57fdb2..e1475bd8 100644 --- a/app/assets/javascripts/polaris_view_components.js +++ b/app/assets/javascripts/polaris_view_components.js @@ -639,7 +639,7 @@ class Dropzone extends Controller { this.element.classList.toggle("Polaris-DropZone--hasError", show); } renderFile(file) { - const validImageTypes = [ "image/gif", "image/jpeg", "image/png" ]; + const validImageTypes = [ "image/gif", "image/jpeg", "image/png", "image/svg+xml" ]; const clone = this.itemTemplateTarget.content.cloneNode(true); const [icon, thumbnail, content, fileSize] = [ clone.querySelector('[data-target="icon"]'), clone.querySelector('[data-target="thumbnail"]'), clone.querySelector('[data-target="content"]'), clone.querySelector('[data-target="file-size"]') ]; if (validImageTypes.includes(file.type)) { diff --git a/app/assets/javascripts/polaris_view_components/dropzone_controller.js b/app/assets/javascripts/polaris_view_components/dropzone_controller.js index 29c9d86a..c9f66e95 100644 --- a/app/assets/javascripts/polaris_view_components/dropzone_controller.js +++ b/app/assets/javascripts/polaris_view_components/dropzone_controller.js @@ -332,7 +332,7 @@ export default class extends Controller { } renderFile (file) { - const validImageTypes = ['image/gif', 'image/jpeg', 'image/png'] + const validImageTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/svg+xml'] const clone = this.itemTemplateTarget.content.cloneNode(true) const [icon, thumbnail, content, fileSize] = [ clone.querySelector('[data-target="icon"]'),