Replace select2 with custom JS dropdown library

Forums › Forums › Search & Filter Pro › Replace select2 with custom JS dropdown library

Viewing 4 posts – 1 through 4 (of 4 total)
  • Anonymous
    #220475

    Hi,

    We are using a dropdown (select) in our filter.

    We would like to replace it with a custom JS library. Select2 and Chosen are functionally interesting but visually not so good looking (which is important for this project).

    We would like to replace it with: https://github.com/patrickkunka/easydropdown or https://hernansartorio.com/jquery-nice-select/

    In both cases we use the standard S&F select.

    When we activate the custom js library, the dropdowns appear but do not work. When you click to open, they close immediately again.

    Probably a conflict between S&F and the JS libraries.

    Is there a way we can get these working?

    Anonymous
    #220476
    This reply has been marked as private.
    Trevor
    #220512

    It seems to be this aria-hidden attribute. The JavaScript should be toggling it, I think.

    https://www.screencast.com/t/7ae5414bz9V

    If, after running those two console lines, you edit the HTML of that line, and remove the aria-hidden, on clicking the dropdown, your code adds it back, and then correctly toggles the dropdown.

    I am guessing there must be a small issue in the code?

    Select2 is widely used in WordPress and customisable. More importantly, it is actively maintained, by members of the Automattic team and others. The script you are using has not been actively maintained for many years.

    Anonymous
    #220546

    Thanks for the feedback.

    We decided to stick with select2 and style it the way we wanted it.

    You can mark it as solved

    Thanks!

Viewing 4 posts – 1 through 4 (of 4 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.