diff --git a/webapp/src/widgets/valueSelector.tsx b/webapp/src/widgets/valueSelector.tsx index b015fd7a7..8f8164d58 100644 --- a/webapp/src/widgets/valueSelector.tsx +++ b/webapp/src/widgets/valueSelector.tsx @@ -32,18 +32,18 @@ type State = { } class ValueSelector extends React.Component { - public constructor(props: Props) { + constructor(props: Props) { super(props) this.state = { activated: false, } } - public shouldComponentUpdate(): boolean { + shouldComponentUpdate(): boolean { return true } - renderLabel = (option: IPropertyOption, meta: FormatOptionLabelMeta): React.ReactNode => { + private renderLabel = (option: IPropertyOption, meta: FormatOptionLabelMeta): React.ReactNode => { if (meta.context === 'value') { return {option.value} } @@ -76,7 +76,7 @@ class ValueSelector extends React.Component { ) } - public render(): JSX.Element { + render(): JSX.Element { if (!this.state.activated) { return (
{ } return ( ({ ...provided, @@ -138,6 +139,8 @@ class ValueSelector extends React.Component { onChange={(value: ValueType, action: ActionMeta): void => { if (action.action === 'select-option') { this.props.onChange((value as IPropertyOption).id) + } else if (action.action === 'clear') { + this.props.onChange('') } }} onCreateOption={this.props.onCreate}