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

Commit b11b359

Browse files
committed
fix(bootstrap): change match element to prevent clicking conflict with allow-clear
1 parent 61a18d5 commit b11b359

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/bootstrap/match.tpl.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<div class="ui-select-match" ng-hide="$select.open" ng-disabled="$select.disabled" ng-class="{'btn-default-focus':$select.focus}">
2-
<button type="button" tabindex="-1"
2+
<span tabindex="-1"
33
class="btn btn-default form-control ui-select-toggle"
44
aria-label="{{ $select.baseTitle }} activate"
55
ng-disabled="$select.disabled"
6-
ng-click="$select.activate()">
6+
ng-click="$select.activate()"
7+
style="outline: 0;">
78
<span ng-show="$select.isEmpty()" class="ui-select-placeholder text-muted">{{$select.placeholder}}</span>
89
<span ng-hide="$select.isEmpty()" class="ui-select-match-text pull-left" ng-class="{'ui-select-allow-clear': $select.allowClear && !$select.isEmpty()}" ng-transclude=""></span>
910
<i class="caret pull-right" ng-click="$select.toggle($event)"></i>
1011
<a ng-show="$select.allowClear && !$select.isEmpty()" aria-label="{{ $select.baseTitle }} clear" style="margin-right: 10px"
1112
ng-click="$select.clear($event)" class="btn btn-xs btn-link pull-right">
1213
<i class="glyphicon glyphicon-remove" aria-hidden="true"></i>
1314
</a>
14-
</button>
15+
</span>
1516
</div>

test/select.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('ui-select tests', function() {
8585
}
8686

8787
function getMatchLabel(el) {
88-
return $(el).find('.ui-select-match > button:first > span[ng-transclude]:not(.ng-hide)').text();
88+
return $(el).find('.ui-select-match > span:first > span[ng-transclude]:not(.ng-hide)').text();
8989
}
9090

9191
function clickItem(el, text) {
@@ -99,7 +99,7 @@ describe('ui-select tests', function() {
9999
}
100100

101101
function clickMatch(el) {
102-
$(el).find('.ui-select-match > button:first').click();
102+
$(el).find('.ui-select-match > span:first').click();
103103
scope.$digest();
104104
}
105105

0 commit comments

Comments
 (0)