#120 - Fix for choice and number field

This commit is contained in:
Elio Struyf
2021-09-30 08:41:35 +02:00
parent 579e4925c8
commit f5e7526fae
@@ -1,5 +1,6 @@
import { CalculatorIcon } from '@heroicons/react/outline';
import * as React from 'react';
import { useEffect } from 'react';
import { VsLabel } from '../VscodeComponents';
export interface INumberFieldProps {
@@ -21,6 +22,12 @@ export const NumberField: React.FunctionComponent<INumberFieldProps> = ({label,
onChange(newValue);
};
useEffect(() => {
if (nrValue !== value) {
setNrValue(value);
}
}, [value]);
return (
<div className={`metadata_field`}>
<VsLabel>