How to fix Chosen with bootstrap not working properly

By FoxLearn 2/16/2024 9:12:44 AM   220
This post shows you How to fix chosen with bootstrap not working properly.

You should modify your configuration as shown below.

<script type="text/javascript">
    $(document).ajaxComplete(function () {
        $('.chosen-select').chosen({ allow_single_deselect: true, width: "100%" });
    });
</script>

Do the same way, you can solve chosen plugin displaying in bootstrap modal not working when using PartialView in ASP.NET MVC.

You can also initialize to pass options with "width" property like in this, or any other width value.

$("select").chosen({width: "inherit"}) 

or

$('.chosen-container').css({ 'width':'350px' });

I hope so you can fix chosen dropdown not working in bootstrap Model.