diff --git a/docs/examples/demo-disable-search.html b/docs/examples/demo-disable-search.html index a6555fdb7..3b65c14b9 100644 --- a/docs/examples/demo-disable-search.html +++ b/docs/examples/demo-disable-search.html @@ -23,6 +23,18 @@

Bootstrap theme

+
+

Number Selected: {{ctrl.multipleDemo.selectedPeople.length}}

+ + {{$item.name}} <{{$item.email}}> + +
+ + email: {{person.email}} + age: + +
+

Select2 theme

Selected: {{ctrl.person.selected}}

@@ -36,7 +48,18 @@

Select2 theme

- +
+

Number Selected: {{ctrl.multipleDemo.selectedPeople.length}}

+ + {{$item.name}} <{{$item.email}}> + +
+ + email: {{person.email}} + age: + +
+

Selectize theme

Selected: {{ctrl.country.selected}}

diff --git a/src/bootstrap/select.tpl.html b/src/bootstrap/select.tpl.html index 293e51a51..bed1e4d77 100644 --- a/src/bootstrap/select.tpl.html +++ b/src/bootstrap/select.tpl.html @@ -6,9 +6,10 @@ aria-owns="ui-select-choices-{{ $select.generatedId }}" aria-activedescendant="ui-select-choices-row-{{ $select.generatedId }}-{{ $select.activeIndex }}" class="form-control ui-select-search" + ng-class="{ 'ui-select-search-hidden' : !$select.searchEnabled }" placeholder="{{$select.placeholder}}" ng-model="$select.search" - ng-show="$select.searchEnabled && $select.open"> + ng-show="$select.open">
diff --git a/src/common.css b/src/common.css index 0a843ea18..051c3154d 100644 --- a/src/common.css +++ b/src/common.css @@ -74,6 +74,16 @@ body > .select2-container.open { border-bottom-color: #5897fb; } +.ui-select-container[theme="select2"] .ui-select-dropdown .ui-select-search-hidden, +.ui-select-container[theme="select2"] .ui-select-dropdown .ui-select-search-hidden input{ + opacity: 0; + height: 0; + min-height: 0; + padding: 0; + margin: 0; + border:0; +} + /* Selectize theme */ /* Helper class to show styles when focus */ @@ -99,10 +109,19 @@ body > .select2-container.open { /* Handle up direction Selectize */ .ui-select-container[theme="selectize"].direction-up .ui-select-dropdown { box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25); - margin-top: -2px; /* FIXME hardcoded value :-/ */ } +.ui-select-container[theme="selectize"] input.ui-select-search-hidden{ + opacity: 0; + height: 0; + min-height: 0; + padding: 0; + margin: 0; + border:0; + width: 0; +} + /* Bootstrap theme */ /* Helper class to show styles when focus */ @@ -145,6 +164,15 @@ body > .select2-container.open { border-bottom-right-radius: 0 !important; } +.ui-select-bootstrap .ui-select-search-hidden{ + opacity: 0; + height: 0; + min-height: 0; + padding: 0; + margin: 0; + border:0; +} + .ui-select-bootstrap > .ui-select-match > .btn{ /* Instead of center because of .btn */ text-align: left !important; diff --git a/src/select2/select.tpl.html b/src/select2/select.tpl.html index 7b905a63f..60629c9b0 100644 --- a/src/select2/select.tpl.html +++ b/src/select2/select.tpl.html @@ -6,7 +6,7 @@