diff --git a/core/modules/file/file.js b/core/modules/file/file.js index 3c6d19a4c3..96e6b49c66 100644 --- a/core/modules/file/file.js +++ b/core/modules/file/file.js @@ -155,6 +155,10 @@ // Remove any previous errors. $('.file-upload-js-error').remove(); + if (this.value === '') { + event.stopImmediatePropagation(); + return; + } // Add client side validation for the input[type=file]. const extensionPattern = event.data.extensions.replace(/,\s*/g, '|'); if (extensionPattern.length > 1 && this.value.length > 0) {