How can you have a harvesthq Chosen dropdown with a dynamic width style?
By default it has a fixed width and if you try to modify it with CSS you will have several p
Here is the simple why I did it.
JS:
// Create Chosen Select Menus
setUpSelectMenus();
// Reset Chosen Select Menus when window changes size
window.addEventListener( "resize", function() { setUpSelectMenus(); } );
/**
* Settings for Default Chosen Select Menus
*/
function setUpSelectMenus(){
$( '.chosen-select' )
.chosen( "destroy" ) // Need this to make responsive
.chosen(
{
allow_single_deselect : true,
disable_search_threshold: 10
}
);
}