Clear the internal file selector after clearPublish

This commit is contained in:
Yamboy1 2020-01-16 08:46:04 +13:00 committed by Sean Yesmunt
parent 8df1e3f6c7
commit 25897d935f

View file

@ -18,6 +18,14 @@ type 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 = {
type: 'file',
};