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)