Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using NG-Select with FormArray #993

Closed
neil-coutinho opened this issue Dec 14, 2018 · 2 comments · Fixed by #996
Closed

Using NG-Select with FormArray #993

neil-coutinho opened this issue Dec 14, 2018 · 2 comments · Fixed by #996

Comments

@neil-coutinho
Copy link

neil-coutinho commented Dec 14, 2018

Is your feature request related to a problem? Please describe.
I'm trying to use ng-select with a FromGroup containing a FormArray of dropdowns. Each dropdown is loaded with a basic list of 10 items. A user can search for an item using the typeahead.

How do I preserve the selected values of the async list and at the same time update the list while searching

Demo

I have 2 lists a set of names stored in people and another list ateam(for demo purposes) containing names starting with the letter a

My dropdown is initially empty and on typeahead the async list$ is updated.

If I initially search for items from the second list i.e 'ateam' and select an item from it and then search for an item from the first list. My previous selection is lost.

Describe the solution you'd like
I'd like to preserve the selected items even if the async list is updated

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context

angular-ypybo3 - StackBlitz.webm.zip

@varnastadeus
Copy link
Member

your bindValue is incorrect which causes the issue. Also I have added some improvements so this case would be handled correctly in #996

AndersTornkvist added a commit to AndersTornkvist/ng-select that referenced this issue Dec 31, 2018
* remotes/main/master: (25 commits)
  chore(release): 2.13.3
  fix: keep selected items while bindValue is incorrect closes ng-select#993
  chore(release): 2.13.2
  fix: appended dropdown position (ng-select#957)
  chore(release): 2.13.1
  fix: map selected items while source changed closes ng-select#980, ng-select#977, ng-select#959
  chore(release): 2.13.0
  [fix] - $event.path does not work in Safari and Firefox. Replace with $event.composedPath(). (ng-select#968)
  feat(templates): add searchTerm to header and footer (ng-select#961)
  chore(release): 2.12.1
  chore: include scss with package closes ng-select#909
  fix: use classList instead of className closes ng-select#940
  add aria-selected attribute on selected items (ng-select#936)
  fix: handler mousedown for clear event when used animation library (ng-select#931)
  chore(release): 2.12.0
  feat(autofocus): focus if attribute is present (ng-select#924)
  feat(isOpen): treat undefined value as default behaviour closes ng-select#816
  feat: allow to customise clear icon fixes ng-select#835
  chore(demo): fix virtual scroll example closes ng-select#921
  fix: keep items order while mapping selected options fixes ng-select#907
  ...
@neil-coutinho
Copy link
Author

neil-coutinho commented Jan 2, 2019

@varnastadeus Thank you for the update and Happy New Year.

NickMele pushed a commit to NickMele/ng-select that referenced this issue Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants