The New Way to Build! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Learn More

Select2 theme does not initialize properly, documentation missing


Hi,

In a similar notion to the question I asked here, https://devs.keenthemes.com/question/alert-style-does-not-initialize-according-to-documentation

I have encountered an issue where the theme for select2 dropdowns does not initialize correctly with supplied documentation

https://preview.keenthemes.com/metronic8/demo1/documentation/forms/select2.html#multiple-selection


The issue here is that there is a theme selection process...

The select2 appearance in the documentation and metronic demo 1 examples uses the "bootstrap5" theme designation, but with a standard implementation of select2 as per the docs, the dropdown will adopt the "default" theme, which is substantially more ugly

The css class that controls all of this is dynamic and controlled by the JS lib, so I cannot easily "hack it".

I assume you guys have a way of forcing the theme because your implementations look correct... I am just not sure how you are doing it, it does not appear to be tag/attribute based.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)


I have been able to circumvent this issue by applying a custom attribute as defined in the select2 documentation



By applying data-theme='boostrap5' to the tag, you can get the desired appearance

I think that this should be highlighted in the docs and/or a more official solution be in place



Hi,

The multiselect Select2 example should work as its working in the preview and documentation. May I know what is your Metronic version?

Regard.



Noted, we will double-check it.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(