From e1cd78c3f63a9c94763eb5df5332d988ab31a2eb Mon Sep 17 00:00:00 2001 From: Stefan Zollinger Date: Thu, 17 Nov 2016 11:04:51 +0100 Subject: [PATCH 1/2] 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. --- src/uiSelectChoicesDirective.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/uiSelectChoicesDirective.js b/src/uiSelectChoicesDirective.js index ed4997f81..f33ee72f1 100644 --- a/src/uiSelectChoicesDirective.js +++ b/src/uiSelectChoicesDirective.js @@ -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; From a68888871307b943e4cc1ff20e5e70ba59fac39d Mon Sep 17 00:00:00 2001 From: Stefan Zollinger Date: Fri, 18 Nov 2016 09:35:14 +0100 Subject: [PATCH 2/2] fix(uiSelectChoicesDirective): use element reference instead of template element in link function --- src/uiSelectChoicesDirective.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uiSelectChoicesDirective.js b/src/uiSelectChoicesDirective.js index f33ee72f1..463a2bcf2 100644 --- a/src/uiSelectChoicesDirective.js +++ b/src/uiSelectChoicesDirective.js @@ -79,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'); } }); };