You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You could wrap the ObjectField (or ObjectFieldTemplate) and include a React.Context that stores the current depth, and adds 1 in each instance.
You also might be able to parse the ID. Assuming your ID splits on _ and you don't use _ in your field names, the number of _ characters in the ID should map to the depth of the property.
You may need to tweak either of these approaches to also account for items in arrays, depending on your needs.
Prerequisites
What theme are you using?
core
What is your question?
I am using nested forms, and would like to know is there a way to find out how "deep" I am.
Context - I would like to use headings (for accessibility) and would like to apply H1-H6 depending on how deep the form is.
Different approaches welcome.
The text was updated successfully, but these errors were encountered: