Skip to content

Commit

Permalink
fix(app-headless-cms): fixing useParentField hook for high level parents
Browse files Browse the repository at this point in the history
Refs: #4163
  • Loading branch information
ma-schmidt-de authored and Pavel910 committed Jun 12, 2024
1 parent 63ad55f commit 33054cf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function useParentField(level = 0): ParentField | undefined {
return undefined;
}

return level === 0 ? parent : parent.getParentField(level);
return level === 0 ? parent : parent.getParentField(level - 1);
}

interface ParentFieldProviderProps {
Expand Down

0 comments on commit 33054cf

Please sign in to comment.