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

fix(uiSelect): directives being created 2 times on ui-select-choices #1132

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/uiSelectChoicesDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ uis.directive('uiSelectChoices',
return {
restrict: 'EA',
require: '^uiSelect',
priority: 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bad hack - one should never have to do priority: 1 to work around issues.

terminal: true,
replace: true,
transclude: true,
templateUrl: function(tElement) {
Expand Down Expand Up @@ -48,7 +50,7 @@ uis.directive('uiSelectChoices',
if (rowsInner.length !== 1) throw uiSelectMinErr('rows', "Expected 1 .ui-select-choices-row-inner but got '{0}'.", rowsInner.length);
rowsInner.attr('uis-transclude-append', ''); //Adding uisTranscludeAppend directive to row element after choices element has ngRepeat

$compile(element, transcludeFn)(scope); //Passing current transcludeFn to be able to append elements correctly from uisTranscludeAppend
$compile(element, transcludeFn, 1)(scope); //Passing current transcludeFn to be able to append elements correctly from uisTranscludeAppend

scope.$watch('$select.search', function(newValue) {
if(newValue && !$select.open && $select.multiple) $select.activate(false, true);
Expand Down