fix: path generation and usages in saving new and existing files for nested collections

This commit is contained in:
Daniel Lautzenheiser
2023-04-17 12:11:06 -04:00
parent 2eaecc948e
commit 117320046f
13 changed files with 109 additions and 38 deletions

View File

@ -14,12 +14,13 @@ const StringControl: FC<WidgetControlProps<string, StringOrTextField>> = ({
field,
forSingleList,
duplicate,
controlled,
onChange,
}) => {
const [internalRawValue, setInternalValue] = useState(value ?? '');
const internalValue = useMemo(
() => (duplicate ? value ?? '' : internalRawValue),
[internalRawValue, duplicate, value],
() => (controlled || duplicate ? value ?? '' : internalRawValue),
[controlled, duplicate, value, internalRawValue],
);
const ref = useRef<HTMLInputElement | null>(null);