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

AutocompleteArrayInput disableCloseOnSelect prop not respected #7792

Closed
nerixim opened this issue Jun 7, 2022 · 3 comments
Closed

AutocompleteArrayInput disableCloseOnSelect prop not respected #7792

nerixim opened this issue Jun 7, 2022 · 3 comments
Labels

Comments

@nerixim
Copy link

nerixim commented Jun 7, 2022

What you were expecting:

AutocompleteArrayInput should not close after selection when disableCloseOnSelect is true.

What happened instead:

It closes after each selection.

Steps to reproduce:

Related code:

Codesandbox (Categories field on create post form)

Other information:

Environment

  • React-admin version: 4.1.2
  • Last version that did not exhibit the issue (if applicable):
  • React version: 18.1
  • Browser:
  • Stack trace (in case of a JS error):
@antoinefricker
Copy link
Contributor

Thanks for the report. Bug spotted!

@antoinefricker antoinefricker added bug and removed bug labels Jun 7, 2022
@MathiasDierickx
Copy link

MathiasDierickx commented Jun 29, 2022

The reason is because blurOnSelect is enabled by default.
Setting both disableCloseOnSelect and blurOnSelect={false} fixes this.
https://codesandbox.io/s/playground-demo-material-ui-forked-wjnm0d?file=/demo.js

@arimet
Copy link
Contributor

arimet commented Aug 22, 2022

Indeed, the mui documentation should at least stipulate that the two props cannot coexist. An issue has been opened.
Meanwhile as MathiasDierickx points out, adding blurOnSelect={false} to the AutocompleteArrayInput fixes the problem

@arimet arimet closed this as completed Aug 22, 2022
TurtIeSocks added a commit to TurtIeSocks/react-admin that referenced this issue Jan 11, 2023
Adds an additional tip that may save some future headaches, source: marmelab#7792
slax57 pushed a commit that referenced this issue Feb 10, 2023
Adds an additional tip that may save some future headaches, source: #7792
amilosmanli pushed a commit to amilosmanli/react-admin that referenced this issue Mar 11, 2023
Adds an additional tip that may save some future headaches, source: marmelab#7792
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants