0

I am using ng-angular-autocomplete which works perfectly fine with chrome but with IE it creates an issue after selecting something from suggestion box. Can you help me how to resolve this issue.

As you can see in the below image after i select something the suggestion box is still seen with no values. But in chrome it is not seen. What could be the issue?

enter image description here

Code :

<ng-autocomplete class="text-left ng-autocomplete ml-1 mr-1"  [data]="iLevelDataItems" [minQueryLength]="2"  [searchKeyword]="keyword" [itemTemplate]="itemTemplate" 
                        placeHolder="search iLevel data items"  [(ngModel)]="iLevelDataItem" [ngModelOptions]="{standalone: true}" [notFoundTemplate]="notFoundTemplate">
                    </ng-autocomplete>

                    <ng-template  #itemTemplate let-item>
                        <a [innerHTML]="item.excelName"></a>
                    </ng-template>

                    <ng-template #notFoundTemplate let-notFound>
                        <div [innerHTML]="notFound"></div>
                    </ng-template>

CSS :

.ng-autocomplete{
    width: auto;
    height: calc(1.5em + 0.5rem + 2px);
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
    vertical-align: middle;
    border:1px solid #ced4da;
}
::ng-deep{
    .suggestions-container{       
        width: 300px!important;
    }

    .autocomplete-container .input-container .x{
        display: none;
    }

    .autocomplete-container .input-container input{
        height:100%!important;
        line-height:100%!important;
        border-radius: 0.2rem;
    }
}
Shlok Nangia
  • 2,355
  • 3
  • 16
  • 24
ashish
  • 282
  • 8
  • 27
  • Try to clear IE browser data (cache and cookie) and recheck whether the site works well?And you could also use F12 developer tools to check if there has some error?According to [this article](https://www.freakyjolly.com/autocomplete-using-angular-ng-autocomplete-package-tutorial-by-example/) and [this sample](https://stackblitz.com/edit/angular-ng-autocomplete?file=src%2Fapp%2Fapp.component.html), I have created a sample,it seems that everything works well in IE browser, please check it.If still not working,can you create a [stackblitz sample](https://stackblitz.com/) to reproduce the problem. – Zhi Lv Apr 24 '20 at 09:22
  • @ZhiLv-MSFT I tried in private mode but it doesnt work.There are no errors , it works fine in chrome. Also the sample https://gmerabishvili.github.io/angular-ng-autocomplete/ doesnot open in IE – ashish Apr 24 '20 at 09:41
  • Please check the polyfill.ts file and your configure file, make sure you have added the polyfill for IE browser. – Zhi Lv Apr 24 '20 at 09:47
  • @ZhiLv-MSFT how do i add that? can you help me with that – ashish Apr 24 '20 at 10:00
  • @ZhiLv-MSFT The below are added for IE browser :import 'core-js/es6/symbol'; import 'core-js/es6/object'; import 'core-js/es6/function'; import 'core-js/es6/parse-int'; import 'core-js/es6/parse-float'; import 'core-js/es6/number'; import 'core-js/es6/math'; import 'core-js/es6/string'; import 'core-js/es6/date'; import 'core-js/es6/array'; import 'core-js/es6/regexp'; import 'core-js/es6/map'; import 'core-js/es6/weak-map'; import 'core-js/es6/set'; import 'classlist.js'; /** IE10 and IE11 requires the following for the Reflect API. */ import 'core-js/es6/reflect'; – ashish Apr 24 '20 at 10:27
  • import 'web-animations-js'; this is also added – ashish Apr 24 '20 at 10:29
  • If you are using angular 8, you can refer [this link](https://stackoverflow.com/questions/56379067/how-do-i-support-internet-explorer-in-an-angular-8-application) to configure the application to use ES5. Besides, please check [this sample](https://stackblitz.com/edit/angular-jzc7ph)(you can download it and navigate to the folder, then run `npm install` command to install the related package and use `ng serve --open` to run the application, check the tsconfig file,I set the target to es5), the result in my IE browser [like this](https://i.stack.imgur.com/OQCam.gif). – Zhi Lv Apr 24 '20 at 11:58

0 Answers0