Gbuomprisco / ngx-chips

Tag Input component for Angular
MIT License
902 stars 359 forks source link

Handling of multiple observables is buggy #841

Open rdicroce opened 5 years ago

rdicroce commented 5 years ago

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 When using autocompleteObservable with a remote source that has a delay, the loading bar is buggy. Sometimes multiple bars show up, and sometimes the loading animation continues even after loading is complete.

Expected behavior There should be only 1 loading bar, and the animation should terminate when loading is complete.

Minimal reproduction of the problem with instructions (if applicable) You can reproduce this using the demo app, if GitHub is slow enough to respond. Scroll down to "Tags accepting only items from an autocomplete using a remote endpoint". Type a letter and wait for the request to be started, then quickly type another letter before the request completes. This seems to trigger a 2nd request, which is to be expected, but ngx-chips doesn't seem to forget about the first request. IMO it should, because the last request is the only useful one.

What do you use to build your app?. Please specify the version Whatever the demo app is using.

Angular version: Whatever the demo app is using.

ngx-chips version: Whatever the demo app is using.

Browser: Reproduced in Firefox 63.0.1 and Chrome 70.0.3538.102, but presumably happens in all browsers.

Zabudska-Yuliia commented 5 years ago

Hey Guys,

Do you have any updates regarding this issue?

rdicroce commented 5 years ago

We replaced ngx-chips and a couple other libraries with ng-select.

Zabudska-Yuliia commented 5 years ago

@rdicroce thanks for the response

KevinABoucher commented 5 years ago

The code should probably be using a switchMap, perhaps the same issue as: https://github.com/Gbuomprisco/ngx-chips/issues/908