Fix call to onValueChange

This commit is contained in:
Oliver Walters 2026-06-24 13:20:45 +00:00
parent da0e9ef95f
commit 4df12736dc
1 changed files with 3 additions and 2 deletions

View File

@ -170,10 +170,11 @@ export function TreeField({
const onChange = useCallback(
(val: string | null) => {
const pk = val ? Number.parseInt(val, 10) : null;
const raw = val ? (nodeMap[val] ?? {}) : {};
field.onChange(pk);
definition.onValueChange?.(pk);
definition.onValueChange?.(pk, raw);
},
[field, definition]
[field, definition, nodeMap]
);
const selectValue = useMemo(