MUI/material-ui theme's ArrayFieldTemplate
renders items in double grid container
#3863
Closed
4 tasks done
Labels
Prerequisites
What theme are you using?
mui
Version
5.x
Current Behavior
For the MUI and material-ui themes, the
ArrayFieldTemplate
renders theArrayFieldItemTemplate
components inside of a grid container and those components also render a grid container. For custom themes that add default spacing to grid items, this can result in double negative spacing margins on the container which causes the field description text to be obscured.The current grid structure in ArrayFieldTemplate:
Changing the
ArrayFieldItemTemplate
wrapper to a grid item fixes the issue:Expected Behavior
The grid in
ArrayFieldTemplate
should be correctly rendered with the structureArrayFieldTemplate > grid-containter > grid-item(ArrayFieldItemTemplate)
so it is not possible for theArrayFieldItemTemplate
to create double negative margins and obscure the field description text.Steps To Reproduce
ArrayFieldTemplate
in a MUI or material-ui theme e.g.Environment
Anything else?
CodeSandbox: https://codesandbox.io/p/sandbox/festive-benji-jt6tjv?file=/pages/index.tsx:17,34
How a fix would look rendered:

The text was updated successfully, but these errors were encountered: