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
When a page has more than one column-visibility UI (for example a main DataTable with ColumnsButton and a nested DatagridConfigurable with SelectColumnsButton), clicking the text label next to a switch in the inner picker should show/hide columns for that inner grid only—the same as clicking the switch itself.
What happened instead:
Clicking the label toggled columns on the outer (main) grid. Clicking the Switch still toggled the correct (inner) grid.
Steps to reproduce:
Use a List with DataTable and ColumnsButton (column picker) on the main list.
Inside an expanded row (or any nested view), render another list with DatagridConfigurable / SelectColumnsButton (second column picker).
Ensure both pickers can be present in the DOM (e.g. main ColumnsButton Popover uses keepMounted, so ColumnsSelector can keep rendering FieldToggle items in a portal even when the popover looks closed).
Open the inner column picker and click a column name (label), not the switch.
Observed: the main table’s column visibility changes. Expected: only the nested table’s columns change.
ColumnsButton uses keepMounted on the Popover, so the portal target for ColumnsSelector can stay mounted; that makes duplicate-id collisions easier to hit when a nested picker is also open (or in edge cases where both trees exist).
We worked around it locally by patching FieldToggle to use React.useId(); upstream fix in ra-ui-materialui would benefit everyone.
What you were expecting:
When a page has more than one column-visibility UI (for example a main
DataTablewithColumnsButtonand a nestedDatagridConfigurablewithSelectColumnsButton), clicking the text label next to a switch in the inner picker should show/hide columns for that inner grid only—the same as clicking the switch itself.What happened instead:
Clicking the label toggled columns on the outer (main) grid. Clicking the
Switchstill toggled the correct (inner) grid.Steps to reproduce:
ListwithDataTableandColumnsButton(column picker) on the main list.DatagridConfigurable/SelectColumnsButton(second column picker).ColumnsButtonPopover uses keepMounted, soColumnsSelector can keep renderingFieldToggleitems in a portal even when the popover looks closed).Observed: the main table’s column visibility changes.
Expected: only the nested table’s columns change.
Related code:
https://codesandbox.io/p/github/marmelab/react-admin-sandbox/csb-pdqfw2/draft/condescending-spence
Other information:
ra-bug.mp4
ColumnsButtonuseskeepMountedon thePopover, so the portal target forColumnsSelectorcan stay mounted; that makes duplicate-id collisions easier to hit when a nested picker is also open (or in edge cases where both trees exist).We worked around it locally by patching
FieldToggleto useReact.useId();upstream fix inra-ui-materialuiwould benefit everyone.Environment