-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
@LukeBaulch can you rebase this? also we should think about how the other themes can implement this feature |
Hi Luke, Dimirc, I'd pretty done the same change (locally) as you Luke. The difference is that I didn't use a function to determine whether to show the search box. I think it's better though with the The key difference is that I modified the template (bootstrap) to deal hiding and showing the search box. select.tpl.html <div class="ui-select-bootstrap dropdown" ng-class="{open: $select.open}">
<div class="ui-select-match"></div>
<input type="text" autocomplete="off" tabindex="-1"
class="form-control ui-select-search"
placeholder="{{$select.placeholder}}"
ng-model="$select.search"
ng-show="$select.open && $select.showSearch()">
<div class="ui-select-choices"></div>
</div> and match.tpl.html <button type="button" class="btn btn-default form-control ui-select-match" tabindex="-1"
ng-hide="$select.open && $select.showSearch()"
ng-disabled="$select.disabled"
ng-class="{'btn-default-focus':$select.focus}"
ng-click="$select.activate()">
<span ng-show="$select.isEmpty()" class="text-muted">{{$select.placeholder}}</span>
<span ng-hide="$select.isEmpty()" ng-transclude></span>
<span class="caret"></span>
</button> |
I just found an issue with my solution. It seems that the collection i was looking at to determine the item count is the post-filtered list, which means if you type into the input filter, it might disappear when the results falls below the defined threshold. |
+1 |
Dimic. I'm not entire sure of the process for proposing a change to you. Do I just clone the repo, make the changes and do a pull request? The solution I have now has keypress handler (on the button) and takes a count of the total data items directly after the parser is created. Tested under IE8. Please advise Sam |
+1 |
@LukeBaulch does #166 resolve this issue? @sambomartin, your can fork the repo, make your changes, commit and then make a pull request. For more information please see the following https://help.github.com/articles/using-pull-requests/ |
As the initial PR was for issue #54 and that is closed I think this can be closed as wel?? @user378230 @aaronroberson |
Added custom attribute 'minimumResultsForSelect' to ui-select directive which will remove the 'select2-with-search' class.
Added styles to hide the search if the 'select2-with-search' class is not applied.
Updated examples to include a case where the search is hidden.
Resolution for Issue #54