From d4444623d271131f890db4db8498f36ec165fa84 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Sat, 2 Dec 2017 10:14:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20editor=20image=20uploads?= =?UTF-8?q?=20(#919)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Ghost/issues/9300 - as of https://github.com/TryGhost/Ghost-Admin/commit/d33cfdac30e788d72249b0541899e406fb4c0133 we reset the file input earlier in the actions chain, this was clearing the file references before the editor was triggering the upload. By converting the `FileList` to an `Array` before resetting the input we keep hold of the file references and the upload works again. --- ghost/admin/app/components/gh-editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/components/gh-editor.js b/ghost/admin/app/components/gh-editor.js index f5ea5396e1..7c1f6538ac 100644 --- a/ghost/admin/app/components/gh-editor.js +++ b/ghost/admin/app/components/gh-editor.js @@ -156,7 +156,10 @@ export default Component.extend({ }, uploadImages(fileList, resetInput) { - this.set('droppedFiles', fileList); + // convert FileList to an array so that resetting the input doesn't + // clear the file references before upload actions can be triggered + let files = Array.from(fileList); + this.set('droppedFiles', files); resetInput(); },