Skip to content

Using Chosen's search box causes images to disapeer until dropdown is reopened #29

Open

Description

@UntouchedWagons

If you go to http://testing.mcresourcecalculator.info/ and choose "Minecraft Forge" in the first drop down, then enter 'Water' into the search box of the second drop-down, the water icon disappears until you close the drop down. Clearing the search box does not restore the images either. I'm using Image-Select 1.7 with Chosen 1.5.1, jQuery 2.2.3

Activity

  1. iLLysion commented on May 23, 2016

    @iLLysion

    I have the same issue

  2. websemantics commented on May 27, 2016

    @websemantics
    Owner

    This has been an issue with Chosen for a while, check #19 .. there is a pending fix harvesthq/chosen#2373 .. I've asked for an update, stay tuned,

  3. iamcal commented on Sep 20, 2016

    @iamcal
    Contributor

    fix will now be either harvesthq/chosen#1626 or harvesthq/chosen#2356

    maybe. one day.

  4. websemantics commented on Sep 20, 2016

    @websemantics
    Owner

    Thanks for the update @iamcal

  5. donni106 commented on May 19, 2017

    @donni106

    Is there something new on this?
    Images also disappear if the search box is disabled but the user presses some keys. Only up/down are working as they are proper inputs to navigate the list items.

  6. shablam commented on Sep 30, 2017

    @shablam

    Hi, I thought I would help out. I am using this plugin here: http://websemantics.github.io/Image-Select/. So for me I like that plugin but same issue the image would disappear after searching. I am capable of programming although not setup for this hard core debugging. In any case I managed to make the image come back after the search. It works.. because I can do it.

    You have to hack the chosen.jquery.js. You can minimize it afterwords if you want.
    Ok, so the file ImageSelect.jquery.js already has a "chosen:filter" event listener in place. So I added in a trigger for the filter event. Then it simply calls the the function in the ImageSelect file after the search result is updated. Keep in mind I am not taking into account groups or anything like that ok. This is just for my needs and maybe this will work fine for you as well.

    Look for the function below and replace it with this. Version 1.8.2, chosen.jquery.js.
    I am sure there is some genius to make this all work better but this works for me.

    Chosen.prototype.update_results_content = function(content) {
          	this.search_results.html(content);
        	return this.form_field_jq.trigger("chosen:filter", { //9-29-17 added in to replace images after search.
            	chosen: this
          	});
    };
    

    I don't have time for a jsfiddle. Hope this helps you. It is super easy to do but took several hours to figure out. I did make custom css for my needs but you can hack that as well. Take it easy.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions