KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Inline width in Select2 #3390

Closed Eugene opened this topic on on Nov 21 - 2 comments

Eugene commented on Nov 21

Hi,

I noticed that the generated HTML code for Select2 includes an inline style specifying the width in pixels. This width is calculated when the page is loaded, which causes layout issues when the page width is adjusted. I don't quite understand why this is done or how it can be overridden. I would prefer the Select2 width to follow the documentation's guidelines or be set to something like width: 100%. Could you advise on how to override the width properly?

Sebastian Morales commented on Nov 22

Select2's width is set in pixel by default if no width option is defined. You can manually set the width to be 100% like this:

    Select2::create(array(
        ...
        "options" => [
            "width" => "100%",
        ],

If there's any issue let us know.

Eugene commented on Nov 25

thank you. it helped

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed
solved

Inputs