Google Maps Autocomplete Result in Bootstrap Modal Dialog

前端 未结 9 933
孤城傲影
孤城傲影 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条回答
  •  萌比男神i
    2020-12-07 18:06

    The problem is with the z-index of the .modal

    Use this CSS markup:

    .pac-container {
        background-color: #FFF;
        z-index: 20;
        position: fixed;
        display: inline-block;
        float: left;
    }
    .modal{
        z-index: 20;   
    }
    .modal-backdrop{
        z-index: 10;        
    }​
    

    Also you can check the final demo here

    ps: thanks to @lilina for that demo on jsfiddle.com

提交回复
热议问题