diff --git a/src/ui/components/common/DirInput.tsx b/src/ui/components/common/DirInput.tsx index 024b2eb..83b54ad 100644 --- a/src/ui/components/common/DirInput.tsx +++ b/src/ui/components/common/DirInput.tsx @@ -14,6 +14,7 @@ interface IProps { readonly?: boolean placeholder?: string folder?: boolean + customClearBehaviour?: () => void } interface IState { @@ -95,6 +96,7 @@ export default class DirInput extends React.Component { if (this.props.onChange) this.props.onChange(text) }} + customClearBehaviour={this.props.customClearBehaviour} />
diff --git a/src/ui/components/common/TextInput.tsx b/src/ui/components/common/TextInput.tsx index 596b0d6..b5c2ee9 100644 --- a/src/ui/components/common/TextInput.tsx +++ b/src/ui/components/common/TextInput.tsx @@ -11,6 +11,7 @@ interface IProps { readOnly?: boolean; id?: string; clearable?: boolean; + customClearBehaviour?: () => void; style?: { [key: string]: any; } @@ -51,6 +52,10 @@ export default class TextInput extends React.Component { { this.props.clearable ?
{ + // Run custom behaviour first + console.log('cleared') + if (this.props.customClearBehaviour) return this.props.customClearBehaviour() + this.setState({ value: '' }) if (this.props.onChange) this.props.onChange('') diff --git a/src/ui/components/menu/Options.tsx b/src/ui/components/menu/Options.tsx index 03b8826..d74a086 100644 --- a/src/ui/components/menu/Options.tsx +++ b/src/ui/components/menu/Options.tsx @@ -154,7 +154,17 @@ export default class Options extends React.Component {
- + { + await setConfigOption('customBackground', '') + window.location.reload() + }} + />