From 9f003106e5366511ab7fef8131e004bc17fcd8f5 Mon Sep 17 00:00:00 2001 From: Henry Desroches Date: Thu, 5 Sep 2019 11:38:27 -0600 Subject: [PATCH] fix(media-library): automatically select uploaded image (#2569) --- .../src/components/MediaLibrary/MediaLibrary.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibrary.js b/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibrary.js index f2ff65c6..b4aa37ac 100644 --- a/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibrary.js +++ b/packages/netlify-cms-core/src/components/MediaLibrary/MediaLibrary.js @@ -176,6 +176,8 @@ class MediaLibrary extends React.Component { await persistMedia(file, { privateUpload }); + this.setState({ selectedFile: this.props.files[0] }); + event.target.value = null; this.scrollToTop();