how to create google autocomplete in bootstrap modal in angular 2+?

蓝咒 提交于 2019-12-05 02:14:30

It works in normal view, and it doesn't work in a modal, so I guess your issue is about z-index css property.

The solution is to set the google autocomplete item's z-index more than the modal bootstrap z-index:

 .pac-container {
    z-index: 1054 !important;
 }

Source: https://github.com/twbs/bootstrap/issues/4160

I'm sure this is the problem because if you just followed all instruction for ngx-bootstrap modal & AGM (you're using an old version is sebm-google-map ) you will notice that there are no error but only the autocomplete item are not showing.

Look in this plunker I created (angular, ngx-bootstrap, angular-google-maps) and all is fine:

https://embed.plnkr.co/N2Oiu5JzirOfUuA8Te3o/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!