diff --git a/addons/mail/static/src/models/file_uploader.js b/addons/mail/static/src/models/file_uploader.js index 3ea8cbd7fcd..66a7bbcd615 100644 --- a/addons/mail/static/src/models/file_uploader.js +++ b/addons/mail/static/src/models/file_uploader.js @@ -38,13 +38,12 @@ Model({ if (!this.exists()) { return; } - if (this.fileInput && this.fileInput.el) { - this.fileInput.el.value = ''; - } if (this.chatterOwner && !this.chatterOwner.hasAttachmentBox) { this.chatterOwner.openAttachmentBox(); } this.messaging.messagingBus.trigger('o-file-uploader-upload', { files }); + // clear at the end because side-effect of emptying `files` + this.fileInput.value = ''; }, /** * @private