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
the column is shown, visibility switched should work changing the visibility of a correct column. Typescript error might appear that the DatagridConfigurable does not expect null as children. This is hard to spot that we miss one column there in the app with 80 lists.
What happened instead:
I used the condition to show one column only in dev mode, and it happened that on PROD the first column was missing from the list
and the column switcher was not switching the visibility of the correct columns, it switched some other columns
Probably the solution is to use {isLocalhost() ? ... : <Fragment/> instead - then the first column of a table is visible again and the visibility switcher works. (but switcher shows "hidden" column as "unlabelled column" which does nothing)
in PostList.tsx you can see the first column as conditionally hidden, it does not appear on the page - then switching the visibility of any column hides a different one
Other information:
Environment
React-admin version:
"react-admin": "4.8.4",
Last version that did not exhibit the issue (if applicable): not sure
React version:
"react": "18.2.0",
Browser: chrome
Stack trace (in case of a JS error):
The text was updated successfully, but these errors were encountered:
in PostList.tsx you can see the first column as conditionally hidden, it does not appear on the page - then switching the visibility of any column hides a different one
What you were expecting:
the column is shown, visibility switched should work changing the visibility of a correct column. Typescript error might appear that the
DatagridConfigurable
does not expect null as children. This is hard to spot that we miss one column there in the app with 80 lists.What happened instead:
I used the condition to show one column only in dev mode, and it happened that on PROD the first column was missing from the list
and the column switcher was not switching the visibility of the correct columns, it switched some other columns
Probably the solution is to use
{isLocalhost() ? ... : <Fragment/>
instead - then the first column of a table is visible again and the visibility switcher works. (but switcher shows "hidden" column as "unlabelled column" which does nothing)...
Steps to reproduce:
Related code:
https://stackblitz.com/edit/github-tpakk4?file=src%2Fposts%2FPostList.tsx,src%2Findex.tsx,src%2Fposts%2Findex.tsx
PostList.tsx
you can see the first column as conditionally hidden, it does not appear on the page - then switching the visibility of any column hides a different oneOther information:
Environment
The text was updated successfully, but these errors were encountered: