Explorar el Código

Fix MappedControl edge case

David Sehnal hace 4 años
padre
commit
92698c486c
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/mol-plugin-ui/controls/parameters.tsx

+ 2 - 1
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);