Forums › Forums › Search & Filter Pro › Replace select2 with custom JS dropdown library
- This topic has 3 replies, 2 voices, and was last updated 5 years, 7 months ago by
Anonymous.
-
Anonymous(Private) September 8, 2019 at 1:32 pm #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?
Trevor(Private) September 9, 2019 at 2:22 pm #220512It 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.
-
AuthorPosts