mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-07-06 09:51:29 +02:00
#120 - Fix for choice and number field
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user