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

ChoiceField select html choices in CollectionField #6259

Open
brunomartin opened this issue Apr 14, 2024 · 0 comments
Open

ChoiceField select html choices in CollectionField #6259

brunomartin opened this issue Apr 14, 2024 · 0 comments

Comments

@brunomartin
Copy link

brunomartin commented Apr 14, 2024

Describe the bug
Explain what you wanted to do and the wrong result you got.
When using ChoiceField in edit form, html select element choices are limited to the ones given a CrudController:
Capture d’écran 2024-04-14 à 22 25 13

When using the same in a CollectionField, the Tom Select clear-button element is available making possible to choose an empty choice:
Capture d’écran 2024-04-14 à 22 27 08

When choosing empty, this leads to following error:

Expected argument of type "string", "null" given at property path ...
Capture d’écran 2024-04-14 à 22 21 37

To Reproduce

  • Make an entity with a ChoiceField.
  • Make another entity with a ManyToOne relation CollectionField the the previous entity.
  • Write CRUD controller for both of them check previously detailed error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant