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

Commit 7aabdc4

Browse files
Stefan Zollingeruser378230
Stefan Zollinger
authored andcommitted
fix(uiSelectChoices): prevent template element from being modified (#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 #1851
1 parent b7ac99a commit 7aabdc4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/uiSelectChoicesDirective.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ uis.directive('uiSelectChoices',
6161

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

64-
scope.$on('$destroy', function() {
65-
choices.remove();
66-
});
67-
6864
scope.$watch('$select.search', function(newValue) {
6965
if(newValue && !$select.open && $select.multiple) $select.activate(false, true);
7066
$select.activeIndex = $select.tagging.isActivated ? -1 : 0;
@@ -83,9 +79,9 @@ uis.directive('uiSelectChoices',
8379

8480
scope.$watch('$select.open', function(open) {
8581
if (open) {
86-
tElement.attr('role', 'listbox');
82+
element.attr('role', 'listbox');
8783
} else {
88-
tElement.removeAttr('role');
84+
element.removeAttr('role');
8985
}
9086
});
9187
};

0 commit comments

Comments
 (0)