Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Ui-select-choices element removed permanently from template in some cases #1851

Closed
zollinger opened this issue Nov 17, 2016 · 1 comment
Closed

Comments

@zollinger
Copy link
Contributor

Bug description:

If ui-select with grouped options is nested within an ng-if that gets toggled a couple of times quickly without first activating the dropdown, the ui-select-choices-row element will be permanently removed from the template and thus, the options will be empty.

Simply removing the code that removes those elements from the template solves this immediate issue:
#1850

This code is supposed to prevent a memory leak, however there was some refactoring done here since and I don't see why this should be a problem now. Maybe the author of
#1365 could create a plunker to reproduce the memory leak?

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/cpMpE6M9MU9FUfhCEoQN?p=preview

Version of Angular, UI-Select, and Bootstrap/Select2/Selectize CSS

Angular: 1.5.8

UI-Select: 0.19.6

Bootstrap/Select2/Selectize CSS: n/a

@user378230
Copy link
Contributor

Thanks will look at getting the PR merged asap

kboga pushed a commit to kboga/ui-select that referenced this issue Nov 29, 2016
…ngular-ui#1850)

* fix(uiSelectChoices): prevent template element from being modified

Previously, the .ui-select-choices-row element got deleted whenever the linked scope got destroyed which prevents rendering of the options in some cases.

* fix(uiSelectChoicesDirective): use element reference instead of template element in link function

Closes angular-ui#1851
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants