diff --git a/src/react-components/create-object-dialog.js b/src/react-components/create-object-dialog.js index 145fda14472b497f7c6b62c8235f699c409c13c9..364bd46b2134fa4c0d97b7d5b5e6342c07dd6e1b 100644 --- a/src/react-components/create-object-dialog.js +++ b/src/react-components/create-object-dialog.js @@ -84,6 +84,7 @@ export default class CreateObjectDialog extends Component { file: null, fileName: "" }); + this.fileInput.value = null; }; render() { @@ -112,7 +113,13 @@ export default class CreateObjectDialog extends Component { {isMobile ? mobileInstructions : desktopInstructions} <form onSubmit={this.onCreateClicked}> <div className={styles.addMediaForm}> - <input id={fileInputId} className={styles.hideFileInput} type="file" onChange={this.onFileChange} /> + <input + id={fileInputId} + ref={f => (this.fileInput = f)} + className={styles.hideFileInput} + type="file" + onChange={this.onFileChange} + /> <div className={styles.inputBorder}> {this.state.file ? filenameLabel : urlInput} {this.state.url || this.state.fileName ? cancelButton : uploadButton}