Google Maps Autocomplete Result in Bootstrap Modal Dialog

前端 未结 9 927
孤城傲影
孤城傲影 2020-12-07 17:22

I have a Google Maps Autocomplete input field inside a Twitter Bootstrap modal dialog and the autocomplete result is not displayed. However, if I press the down arrow key, i

9条回答
  •  时光取名叫无心
    2020-12-07 17:50

    Bootstrap's .modal z-index is by default 1050.

    jQuery UI's .ui-autocomplete z-index is by default 3.

    So put this on the CSS:

    /* Fix Bootstrap .modal compatibility with jQuery UI Autocomplete,
    see http://stackoverflow.com/questions/10957781/google-maps-autocomplete-result-in-bootstrap-modal-dialog */
    .ui-autocomplete {
        z-index: 1051 !important;
    }
    

    Works wonders! :)

提交回复
热议问题