Clear the internal file selector after clearPublish
This commit is contained in:
parent
8df1e3f6c7
commit
25897d935f
1 changed files with 8 additions and 0 deletions
|
@ -18,6 +18,14 @@ type Props = {
|
||||||
};
|
};
|
||||||
|
|
||||||
class FileSelector extends React.PureComponent<Props> {
|
class FileSelector extends React.PureComponent<Props> {
|
||||||
|
componentDidUpdate(prevProps: Props) {
|
||||||
|
// If the form has just been cleared,
|
||||||
|
// clear the file input
|
||||||
|
if (prevProps.currentPath && !this.props.currentPath) {
|
||||||
|
this.fileInput.current.value = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
type: 'file',
|
type: 'file',
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue