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

Input box is hidden with search-enabled="false" with Bootstrap theme #453

Closed
cdjackson opened this issue Nov 29, 2014 · 18 comments
Closed

Comments

@cdjackson
Copy link
Contributor

With the Bootstrap theme, if I add the search-enabled="false" attribute, when the dropdown is clicked, the input box is hidden. This seems strange behaviour - maybe it's intended, but if so, can it be disabled? I want to keep the input box, but just not accept input (similar to how the Selectize theme works).
Aside from being a nuisance in itself, it also causes the parent to resize when the dropdown is opened.

@sebastian-zarzycki
Copy link

+1, this is really weird and unexpected behavior.

@erslater
Copy link

I think this issue is not limited to your scenario. I have a multi-select and initially the input box is 10px wide but when I click in it it expands to full width. Here is the html (using version 0.9.5):

<ui-select multiple ng-model="selected.authorizedUsers">
    <ui-select-match placeholder="Select users...">{{$item.name}}</ui-select-match>
    <ui-select-choices repeat="user in officeUsers | filter: $select.search">
        {{user.name}}
    </ui-select-choices>
</ui-select>

inputbox

@gen4sp
Copy link
Contributor

gen4sp commented Jan 17, 2015

+1 unexpected and unable to fix without fork
Please, remove it or make optional.

@donbobka
Copy link

👍

@chuckrea
Copy link

+1 Just happened to me as well. Very odd.

@dimirc dimirc modified the milestones: 0.12.x, 0.11.x Mar 11, 2015
@brentmiller
Copy link

I am experiencing the same issue but with the select2 theme. Thus the issue isn't limited to the bootstrap theme.

@jedimindtrix9
Copy link

Yes, this is weird. I set a placeholder for default text ie (-select an option-). I am using the selectize theme: Two things I've noticed...1. If I switch the theme to bootstrap, the placeholder option will display. The other option was to set search-enabled to "false". Any help here would be greatly appreciated.

@seinavco
Copy link

+1

Please fix this issue.

@SamPlacette
Copy link

+1 This is affecting me as well. I am working around the problem for now by specifying placeholder text using :before pseudo-selector.

Update: I can workaround using the following CSS:

  .ui-select-bootstrap[search-enabled=false] .ui-select-match.ng-hide {
    display: inline-block !important;
  }
  .ui-select-bootstrap[search-enabled=false] .ui-select-match .text-muted.ng-hide {
    display: inline !important;
  }
  .ui-select-bootstrap[search-enabled=false].ng-dirty .ui-select-match .text-muted.ng-hide {
    display: none !important;
  }

There are probably some edge cases these styles don't support very well...

@sagivf
Copy link

sagivf commented May 12, 2015

+1 It would also be desirable for this to work with the "selectize" theme.

.ui-select-container[search-enabled=false] .ui-select-match.ng-hide {
  display: inline-block !important;
}
.ui-select-container[search-enabled=false] .ui-select-match .text-muted.ng-hide {
  display: inline !important;
}
.ui-select-container[search-enabled=false].ng-dirty .ui-select-match .text-muted.ng-hide {
  display: none !important;
}

Thanks @SamPlacette.

@jedimindtrix9
Copy link

One solution that I found works well with AngularJS if you are familiar with it. The way I solved this is to simply leave the theme as selectize but target you scope in js by using a for loop like this

for(var i=0; i<$scope.yourDropDownName.length; i++){
if($scope.yourDropDownName[i].id=='US'){
$scope.model.yourScopeModelName=$scope.yourDropDownName[i];
break;
}
}

cdjackson added a commit to cdjackson/ui-select that referenced this issue Jul 26, 2015
cdjackson added a commit to cdjackson/ui-select that referenced this issue Jul 26, 2015
* fix_issue_453:
  Don't hide select when SearchEnable is false angular-ui#453
@readme42
Copy link

+1

cdjackson added a commit to cdjackson/ui-select that referenced this issue Aug 1, 2015
cdjackson added a commit to cdjackson/ui-select that referenced this issue Aug 1, 2015
* fix_issue_453:
  Fix test to check against ui-select-offscreen class, not ng-hide
  Update to move search box off screen
  Don't hide select when SearchEnable is false angular-ui#453

Conflicts:
	examples/bootstrap.html
@luklapp
Copy link

luklapp commented Oct 14, 2015

Don't know if this is still an issue, but I fixed it without CSS by changing the template.

Before:
ng-hide="$select.open"

After:
ng-hide="$select.open && $select.searchEnabled"

@alusev
Copy link

alusev commented Dec 3, 2015

Thanks @SamPlacette

@hkorutla
Copy link

I still have the same issue.

srogers202 pushed a commit to RepublicServicesRepository/ui-select that referenced this issue Feb 9, 2016
@crissdev
Copy link

Thanks @SamPlacette for the workaround

I've ended up using display: block for .ui-select-bootstrap[search-enabled=false] .ui-select-match.ng-hide actually.

cdjackson added a commit to cdjackson/ui-select that referenced this issue Mar 26, 2016
angular-ui#453
Update to move search box off screen
Fix test to check against ui-select-offscreen class, not ng-hide

Signed-off-by: Chris Jackson <chris@cd-jackson.com>
@wesleycho wesleycho removed this from the 0.11.x milestone Mar 27, 2016
@developersatish
Copy link

I have a little bit a different issue after disabling the search.
There is a cursor showing with first result, when i did a inspect element i found this a input element with hidden property.
I do not want to show this cursor, how can i disable this.

image

@user378230
Copy link
Contributor

@developersatish what version are you using?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests