diff --git a/src/components/DataKeyPair.tsx b/src/components/DataKeyPair.tsx index 1ef1e3de..d7d858a2 100644 --- a/src/components/DataKeyPair.tsx +++ b/src/components/DataKeyPair.tsx @@ -233,8 +233,9 @@ export const DataKeyPair: FC = (props) => { inspect, setInspect, value, - prevValue - }), [inspect, path, setInspect, value, prevValue]) + prevValue, + nestedIndex + }), [inspect, path, setInspect, value, prevValue, nestedIndex]) return ( > = (props) => { if (Array.isArray(value)) { // unknown[] if (value.length <= groupArraysAfterLength) { - const elements = value.slice(0, displayLength).map((value, index) => { + const elements = value.slice(0, displayLength).map((value, _index) => { + const index = props.nestedIndex ? (props.nestedIndex * groupArraysAfterLength) + _index : _index const path = [...props.path, index] return ( { value: ValueType prevValue: ValueType | undefined path: Path + nestedIndex?: number } export type EditorProps = {