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

feat(uiSelectMultiple): click anywhere to search when using bootstrap theme #2057

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/bootstrap/match-multiple.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ng-click="$selectMultiple.activeMatchIndex = $index;"
ng-class="{'btn-primary':$selectMultiple.activeMatchIndex === $index, 'select-locked':$select.isLocked(this, $index)}"
ui-select-sort="$select.selected">
<span class="close ui-select-match-close" ng-hide="$select.disabled" ng-click="$selectMultiple.removeChoice($index)">&nbsp;&times;</span>
<span class="close ui-select-match-close" ng-hide="$select.disabled" ng-click="$selectMultiple.removeChoice($index, $event)">&nbsp;&times;</span>
<span uis-transclude-append></span>
</span>
</span>
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/select-multiple.tpl.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="ui-select-container ui-select-multiple ui-select-bootstrap dropdown form-control" ng-class="{open: $select.open}">
<div>
<label class="ui-select-search-wrapper">
<div class="ui-select-match"></div>
<span ng-show="$select.open && $select.refreshing && $select.spinnerEnabled" class="ui-select-refreshing {{$select.spinnerClass}}"></span>
<input type="search"
Expand All @@ -17,7 +17,7 @@
aria-label="{{$select.baseTitle}}"
ng-class="{'spinner': $select.refreshing}"
data-disallow-drop=data-disallow-drop>
</div>
</label>
<div class="ui-select-choices"></div>
<div class="ui-select-no-choice"></div>
</div>
8 changes: 8 additions & 0 deletions src/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,11 @@ body > .ui-select-bootstrap.open {
.ui-select-refreshing.ng-animate {
-webkit-animation: none 0s;
}

/* ui-select-multiple search wrapper */
.ui-select-search-wrapper {
display: block;
margin: 0;
cursor: text;
font-weight: normal;
}
6 changes: 5 additions & 1 deletion src/uiSelectMultipleDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
};

// Remove item from multiple select
ctrl.removeChoice = function(index){
ctrl.removeChoice = function(index, event){
// do not open the results dropdown
if(event) {
event.stopPropagation();
}

// if the choice is locked, don't remove it
if($select.isLocked(null, index)) return false;
Expand Down