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

ReferenceArrayInput with AutocompleteArrayInput flickers and resets value on search when used with format and parse #8595

Open
tomek3e opened this issue Jan 23, 2023 · 4 comments · Fixed by #8599
Assignees

Comments

@tomek3e
Copy link

tomek3e commented Jan 23, 2023

What you were expecting:
When using AutocompleteArrayInput with a ReferenceArrayInput with parse/format options:

  • the options list should not flicker
  • the input value should not reset itself

What happened instead:

  • the options list values flicker
  • the input value resets itself

Steps to reproduce:

  1. Open code sandbox
  2. In the preview window, go to Comments list
  3. Click on the icon to create a new comment
  4. Select any value(s) in the Comments input
  5. Enter any few characters

Related code:
CodeSandox: https://codesandbox.io/s/array-reference-input-xrrv94?file=/src/posts/PostCreate.tsx

Environment

  • React-admin version: 4.7.1
@slax57 slax57 added the bug label Jan 23, 2023
@slax57
Copy link
Contributor

slax57 commented Jan 23, 2023

Reproduced, thanks

@tomek3e
Copy link
Author

tomek3e commented Jan 30, 2023

HI, I updated the CodeSanbox to react-admin 4.7.2 but the issue still persist with parse & format options.

@slax57
Copy link
Contributor

slax57 commented Jan 30, 2023

Indeed!
I tried to make sure the format and parse props were not causing the re-render by moving them to a const, but the issue is still there.
The issue is not present however when you remove the format and parse props (which is what the PR #8599 fixed).
Reopening

@slax57 slax57 reopened this Jan 30, 2023
@slax57 slax57 changed the title ReferenceArrayInput with AutocompleteArrayInput flickers and resets value on search ReferenceArrayInput with AutocompleteArrayInput flickers and resets value on search when used with format and parse Jan 30, 2023
@djhi
Copy link
Collaborator

djhi commented Jun 23, 2023

This actually makes sense inside a ReferenceArrayInput as it expects a specific format for the values (array of ids). @tomek3e, would you mind explaining your use case? Otherwise, I'll mark this as a documentation issue.

@djhi djhi added documentation and removed bug labels Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants