Skip to content
Snippets Groups Projects
Commit d4f31f17 authored by netpro2k's avatar netpro2k
Browse files

Fix issue when selecting the same file after clearing

parent 730383cd
No related branches found
No related tags found
No related merge requests found
......@@ -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}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment