Gbuomprisco / ngx-chips

Tag Input component for Angular
MIT License
899 stars 360 forks source link

Multiple calls to autocompleteObservable dosn't use latest #908

Open rbirkgit opened 4 years ago

rbirkgit commented 4 years ago

PLEASE MAKE SURE THAT:

I'm submitting a ... (check one with "x")

[x ] bug report => search github for a similar issue or PR before submitting
[ ] support request/question

Notice: feature requests will be ignored, submit a PR if you'd like

Current behavior We use autocompleteObservable but when the user types, we get multiple calls to it and the latest call is not used. This happens for example when the first call is slower. We want to use a switchMap() but not sure where one can put it. autocompleteObservable doesn't seem like it would work.

Expected behavior Expect the previous calls to to get cancelled if a new one is made before the previous is finished.

Minimal reproduction of the problem with instructions (if applicable)

Example described above

What do you use to build your app?. Please specify the version

Angular cli

Angular version: 7.2

ngx-chips version:

2.0.2

Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

latest chrome, firefox (not browser issue)