Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disableRemove doesn't pass down record object #7644

Closed
andrico1234 opened this issue May 5, 2022 · 2 comments · Fixed by #7645
Closed

disableRemove doesn't pass down record object #7644

andrico1234 opened this issue May 5, 2022 · 2 comments · Fixed by #7645
Labels

Comments

@andrico1234
Copy link
Contributor

It seems that the following code will always log out an empty object in the console.

<ArrayInput source="resourcePools" label="CP Resource Pools" level={2}>
        <SimpleFormIterator
          disableRemove={record => {
            console.log(record);
            return true
          }}
        >
            ...
        </SimpleFormIterator>
</ArrayInput>

What you were expecting:
To be given the record of the current ArrayInput iterable

Steps to reproduce:
If you go to the repro case

  • Navigate to the PostEdit page
  • Add a new post_id
  • Click save
  • Click back into the record

You'll observe that the input is populated, but no data is being passed through to the disableRemove function

Related code:

insert short code snippets here

Other information:

Environment

  • React-admin version:
  • Last version that did not exhibit the issue (if applicable):
  • React version:
  • Browser:
  • Stack trace (in case of a JS error):
@slax57 slax57 added the bug label May 5, 2022
@slax57
Copy link
Contributor

slax57 commented May 5, 2022

Reproduced, thanks!

@andrico1234
Copy link
Contributor Author

I'll be happy to take a pass at this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants