ng2-ui / auto-complete

Angular Auto Complete component and directive
https://ng2-ui.github.io/dist/#/auto-complete
MIT License
279 stars 123 forks source link

open-on-focus is ignored on Internet Explorer #293

Open lstolowski opened 6 years ago

lstolowski commented 6 years ago

It doesn't matter if option open-on-focus=false is set or not. ngui-auto-complete div still appears on Internet Explorer 11.

kevinp1335 commented 6 years ago

It's not just Internet Explorer. It's doing this for me in Chrome as well. The @Input openOnFocus is being read as a string even though it's set to be a boolean. So, in the ngAfterViewInit function when it checks "if (this.openOnFocus)", this expression is always true because this.openOnFocus is a string of the word 'false'.

danail-vasilev commented 6 years ago

Hi Guys, Yes, this issue is reproducible in Chrome as well. Is there any workaround ?

kevinhoelscher commented 6 years ago

I've been testing this locally and may have a workaround. It seems to work if you use the one-way data binding syntax:

[open-on-focus]="false" // works open-on-focus="false" // doesn't work

Note that the similar close-on-focusout does not seem to work using this approach.