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

easyadmin_autocomplete with create: true renders the field twice #169

Open
Naroh091 opened this issue Dec 16, 2019 · 4 comments
Open

easyadmin_autocomplete with create: true renders the field twice #169

Naroh091 opened this issue Dec 16, 2019 · 4 comments

Comments

@Naroh091
Copy link

Using Easyadmin v2.3.4 and EasyAdminExtensionBundle v3.0.0

I'm getting a duplicate field when setting attr: { create: true } in a easyadmin_autocomplete field.

image

The first one allows to create new entries for the entity, while the second doesn't (but it does not create the entry in the end). Selecting an existing option in the first input sets the choice for that field, while doing it in the second one shows the option in both.

image

The easy_admin.yaml for this field is

- { property: 'context.person', label: 'Persona', type: 'easyadmin_autocomplete', type_options: { class: 'App\Entity\Facts\Person', attr: { create: true } } }

Also, I'm getting this errors in the console:

The select2('close') method was called on an element that is not using Select2.
Uncaught TypeError: Cannot read property 'close' of undefined

Any hints would be appreciated :)

@alterphp
Copy link
Owner

Hi @Naroh091 !

I try to ping @gonzakpo on this one. I think this is a side effect of the upgrade but I can't reproduce it.

@gonzaloalonsod
Copy link
Contributor

What version of select2?

@alterphp
Copy link
Owner

@Naroh091 There is no problem when not using create option ?

@Naroh091
Copy link
Author

@gonzakpo I've tried with v4.0.5 and the latest, 4.0.12. I'm using the full-min version.
@alterphp Yep, works fine without create.

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

3 participants