react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

SelectArrayInput throws q.map is not a function

Open chadfaurie opened this issue 4 years ago • 6 comments

What you were expecting:

SelectArrayInput to render correctly The Filter is attached to a List embedded in a Tab on a resource Show page

What happened instead:

Error boundary caught q.map is not a function

Steps to reproduce:

Place a SelectArrayInput on a list filter embedded in a show tab

Related code:

<List
      filter={{
        parentId: record.id,
      }}
      filterDefaultValues={{
        category: ["PERSON"],
      }}
      filters={[ <SelectInput
    key="category"
    source="category"
    choices={[]}
    alwaysOn
  />,]}
      disableSyncWithLocation
    >

Other information:

Environment

  • React-admin version: 4.0.2
  • Last version that did not exhibit the issue (if applicable): ~3
  • React version: 18
  • Browser: Chrome
  • Stack trace (in case of a JS error):

chadfaurie avatar May 05 '22 06:05 chadfaurie

Thanks for reporting this. Please provide a sample application showing the issue by forking the following CodeSandbox (https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/simple).

djhi avatar May 05 '22 07:05 djhi

@djhi I am having issue replicating the issue in codesandbox but this illustrates what I am attempting to do: https://codesandbox.io/s/elated-turing-m7060m?file=/src/posts/PostShow.tsx

I am now setting the filterDefaultValues on the list which seems to stabilize the issue

chadfaurie avatar May 05 '22 07:05 chadfaurie

I can't reproduce the issue on your codesandbox even after removing the filterDefaultValues. Did I miss something?

djhi avatar May 05 '22 10:05 djhi

No, the issue is intermittent and I am still trying to isolate it somehow

Could it be that I am running react 18?

chadfaurie avatar May 05 '22 10:05 chadfaurie

That's possible. Maybe related to the development only "features" of React

djhi avatar May 05 '22 12:05 djhi

No news for some time, closing

fzaninotto avatar Jun 17 '22 12:06 fzaninotto