Skip to content

Commit

Permalink
fix(uiSelectChoices): prevent template element from being modified (a…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Stefan Zollinger authored and Bogaerts Kristof committed Nov 29, 2016
1 parent 259bafa commit a1f4450
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/uiSelectChoicesDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ uis.directive('uiSelectChoices',

$select.dropdownPosition = attrs.position ? attrs.position.toLowerCase() : uiSelectConfig.dropdownPosition;

scope.$on('$destroy', function() {
choices.remove();
});

scope.$watch('$select.search', function(newValue) {
if(newValue && !$select.open && $select.multiple) $select.activate(false, true);
$select.activeIndex = $select.tagging.isActivated ? -1 : 0;
Expand All @@ -83,9 +79,9 @@ uis.directive('uiSelectChoices',

scope.$watch('$select.open', function(open) {
if (open) {
tElement.attr('role', 'listbox');
element.attr('role', 'listbox');
} else {
tElement.removeAttr('role');
element.removeAttr('role');
}
});
};
Expand Down

0 comments on commit a1f4450

Please sign in to comment.