From 92698c486cab3c8905dab9f44b83f1348c111c6b Mon Sep 17 00:00:00 2001 From: David Sehnal <david.sehnal@gmail.com> Date: Thu, 15 Oct 2020 09:11:06 +0200 Subject: [PATCH] Fix MappedControl edge case --- src/mol-plugin-ui/controls/parameters.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mol-plugin-ui/controls/parameters.tsx b/src/mol-plugin-ui/controls/parameters.tsx index a222967fc..9fa7379e5 100644 --- a/src/mol-plugin-ui/controls/parameters.tsx +++ b/src/mol-plugin-ui/controls/parameters.tsx @@ -1193,7 +1193,8 @@ export class MappedControl extends React.PureComponent<ParamProps<PD.Mapped<any> } render() { - const value: PD.Mapped<any>['defaultValue'] = this.props.value; + const value: PD.Mapped<any>['defaultValue'] = this.props.value || this.props.param.defaultValue; + const param = this.props.param.map(value.name); const label = this.props.param.label || camelCaseToWords(this.props.name); const Mapped = controlFor(param); -- GitLab