Is it possible to set the width of a jQuery autocomplete combobox?

后端 未结 14 2261

I am using this jQuery UI combobox autocomplete control out of the box off the jQuery UI website:

My issue is that I have multiple comboboxes on a page, and I want t

14条回答
  •  轮回少年
    2020-12-28 14:20

    It works for me using:

    $.extend($.ui.autocomplete.prototype.options, {
      open: function(event, ui) {
        $(this).autocomplete("widget").css({
                "width": ($(this).outerWidth() + "px")
            });
        }
    });
    

    Thanks Michael Simons https://info.michael-simons.eu/2013/05/02/how-to-fix-jquery-uis-autocomplete-width/

提交回复
热议问题