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

fix(multiple): text input not resized on window resize #1183

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
10 changes: 9 additions & 1 deletion src/uiSelectMultipleDirective.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelectMinErr, $timeout) {
uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', '$window', function(uiSelectMinErr, $timeout, $window) {
return {
restrict: 'EA',
require: ['^uiSelect', '^ngModel'],
Expand Down Expand Up @@ -399,6 +399,14 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
});
});

function onWindowResize() {
$select.sizeSearchInput();
}

angular.element($window).on('resize', onWindowResize);
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be debounced.

scope.$on('$destroy', function() {
angular.element($window).off('resize', null, onWindowResize);
});
}
};
}]);