Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no search icon after click in the drop-down box #4629

Closed
douglasdeodato opened this issue Oct 12, 2016 · 4 comments
Closed

no search icon after click in the drop-down box #4629

douglasdeodato opened this issue Oct 12, 2016 · 4 comments

Comments

@douglasdeodato
Copy link

Prerequisites

  • [ x] I have attempted to find the simplest possible steps to reproduce the issue

Steps to reproduce the issue

  1. browsing bettween the versions 3.5.3 and 4 I realized there is no search icon after click in the dropdown box, that was removed proposital or is a bug?

css class:

.select2-search input {
    width: 100%;
    height: auto !important;
    min-height: 26px;
    padding: 4px 20px 4px 5px;
    margin: 0;
    outline: 0;
    font-family: sans-serif;
    font-size: 1em;
    border: 1px solid #aaa;
    border-radius: 0;
    -webkit-box-shadow: none;
    box-shadow: none;
    background: #fff url(select2.png) no-repeat 100% -22px;
    background: url(select2.png) no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
    background: url(select2.png) no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
    background: url(select2.png) no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
    background: url(select2.png) no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
}

screenshot from 2016-10-12 14-43-09

screenshot from 2016-10-12 14-42-35

Isolating the problem

  • [ x] The bug happens consistently across all tested browsers

Select2 3.5.3
http://select2.github.io/select2/index.html
image removed:
http://select2.github.io/select2/select2-3.5.3/select2.png

version 4
https://select2.github.io/examples.html

@rohanc
Copy link

rohanc commented Jul 4, 2017

I miss this feature too. The magnifying glass image and the CSS to display it seem to be missing from all the v4 themes. My workaround was to lift select2.png and select2x2.png from the v3 files and insert the following CSS into my application:

.select2-container--default .select2-search--dropdown .select2-search__field {
  background: url(select2.png) right top no-repeat;
  background-position: right -22px;
}

@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 2dppx)  {
   .select2-container--default .select2-search--dropdown .select2-search__field {
      background-image: url(select2x2.png);
      background-repeat: no-repeat;
      background-size: 60px 40px;
      background-position: 100% -21px;
   }
}

select2
select2x2

I notice that some people have made their own themes that put the icon back. For example, this Yii2 integration:
http://demos.krajee.com/widget-details/select2

@pedrofurtado
Copy link
Contributor

We don't have immediate plans to provide this. We are focused now to fix UI bugs. But if you open a PR with unit tests, I will be glad to review and approve if everything is ok.

@rohanc
Copy link

rohanc commented Sep 18, 2018

OK, I gather from your response then that this feature wasn't deliberately removed in V4, but that it isn't sufficiently important for the core developers to spend any time on this, other than code review.

Shall I open a PR that adds the missing code to _dropdown.scss?

Assuming that no JS needs changing, I assume unit tests wouldn't be applicable.

@pedrofurtado
Copy link
Contributor

@rohanc Thanks for feedback! Yeah, please, open a PR with this missing code in CSS (and link this issue there). Then I can merge it into develop branch 👍

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

No branches or pull requests

5 participants