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

BetterCMS containment of Select2 is not working #1532

Open
remyblok opened this issue May 25, 2016 · 1 comment
Open

BetterCMS containment of Select2 is not working #1532

remyblok opened this issue May 25, 2016 · 1 comment

Comments

@remyblok
Copy link

remyblok commented May 25, 2016

BetterCMS tries to contain Select2 only within it's own context, but this is failing.

  • The CSS in bcms.root.css applies to all instances of Select2 combo boxes and not only to BetterCMS combo boxes. This can be fixed by adding specific classes to the Select2 combo boxes used by BetterCMS, please refer to the documentation of Select2 for that. See containerCssClass option http://select2.github.io/select2/#documentation
  • Select2 still registers itself in window. Any subsequent versions that are then loaded are not processes because of the assignment of the BCMS version to window. This will require small changes to the source code of Select2 imported in BetterCMS to fix.

Background: we are using Select2 as well in our site. This worked OK in 1.10.x, but now we have upgraded to 2.0.x it does not work anymore. When not logged in as an admin it still works OK, but when the BCMS content is loaded all our combo boxes stop working. We traced it back to the two issues outlines above. We use a different version of Select2 (4.x) then BetterCMS is (3.x).

Could you please fix them? Thanks!

@remyblok
Copy link
Author

For now we fixed it by search/replacing select2 to select3 in our own solution. All our styles and Javascript now use select3 as selector etc. So there is no longer a clash between the two version. I suggest for BCMS to do the same. Search/replace select2 with select2bcms or something. This will make the version you are using private to bcms.

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