When the responsiveDropdown option is true, the width of the dropdown for selecting countries is set to the element's offsetWidth:
if (this.options.responsiveDropdown) {
$(window).resize(function() {
$('.country-select').each(function() {
var dropdownWidth = this.offsetWidth;
$(this).find('.country-list').css("width", dropdownWidth + "px");
});
}).resize();
}
This works well when the element is visible when the code runs, but causes trouble when it's not: the offsetWidth is zero when the element is hidden (MDN). This in turn means that the dropdown's width get set to 0px, making for a suboptimal user experience.
I'm not sure how to go about properly fixing this, but perhaps there could at least be a minimum value greater than 0px for the dropdown's width?
When the responsiveDropdown option is true, the width of the dropdown for selecting countries is set to the element's offsetWidth:
This works well when the element is visible when the code runs, but causes trouble when it's not: the offsetWidth is zero when the element is hidden (MDN). This in turn means that the dropdown's width get set to 0px, making for a suboptimal user experience.
I'm not sure how to go about properly fixing this, but perhaps there could at least be a minimum value greater than 0px for the dropdown's width?