Skip to content

fix(ui): self managed field paths #12290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

fix(ui): self managed field paths #12290

wants to merge 3 commits into from

Conversation

jacobsfletch
Copy link
Member

Fixes #12286. Self managed fields, i.e. custom fields that define their own path as a prop, consume their parent's path instead of the path that was given to them.

This was introduced in #11973 where we began passing a new potentiallyStalePath arg to the useField hook that takes the path from context as priority. This change was necessary in order to fix stale paths during row manipulation while the server is processing.

This change, however, made it so that custom fields could no longer control their own path.

The fix is to lift the potentiallyStalePath logic out of Payload's default fields and pass it as a direct prop. This way the path prop is still available for direct use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use custom paths for payload UI components within custom component
1 participant