jQueryUI autocomplete not working with dialog and zIndex

前端 未结 14 1100
孤独总比滥情好
孤独总比滥情好 2021-02-05 00:51

I ran into an interesting issue with jQueryUI autocomplete in a dialog box.

My dialog HTML looks like this:

14条回答
  •  囚心锁ツ
    2021-02-05 01:07

    Try setting the appendTo option to "#copy_dialog":

    $(/** autocomplete-selector **/)
        .autocomplete("option", "appendTo", "#copy_dialog");
    

    This option specifies which element the autocomplete menu is appended to. By appending the menu to the dialog, the menu should inherit the correct z-index.

提交回复
热议问题