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

JS error on pages using select template override #145

Closed
kp77 opened this issue Dec 21, 2021 · 3 comments
Closed

JS error on pages using select template override #145

kp77 opened this issue Dec 21, 2021 · 3 comments
Labels
fixed The issue has been fixed

Comments

@kp77
Copy link
Contributor

kp77 commented Dec 21, 2021

The /templates/overrides/form/select.html.twig template always attaches the slimselect library, see code.

This causes js errors on pages where the template is used, but there is no element with .multi-select class:

Uncaught Error: Could not find select element

We fixed this issue by overriding this template and only attaching the library when element['#multiple'] is true.

@brummbar
Copy link
Contributor

Is the issue fixed @kp77 ?

@brummbar brummbar added the to be confirmed The bug reported is yet to be investigated and confirmed. label Apr 27, 2022
@kp77
Copy link
Contributor Author

kp77 commented Apr 29, 2022

Hi @brummbar,

No, the issue is not fixed yet. I see a PR that makes the slim select library optional #224, but this still doesn't deal with the issue, that if there is no element on the page with .multi-select class, the library's script throws the error described above.

As you can see here, we fixed this in our override by only including the library together with setting the class.

@brummbar
Copy link
Contributor

We removed completely slim_select on #239 .

@brummbar brummbar added fixed The issue has been fixed and removed to be confirmed The bug reported is yet to be investigated and confirmed. labels Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed The issue has been fixed
Projects
None yet
Development

No branches or pull requests

2 participants