Forums › Forums › Search & Filter Pro › Unable to Change tag for dropdowns
- This topic has 3 replies, 2 voices, and was last updated 5 years, 4 months ago by
Trevor.
-
Anonymous(Private) September 25, 2020 at 11:58 pm #260914
CSS for
<option>tags is ignored by Google Chrome. I am trying to change the<option>tag to<li>or<div>with the relevant class names, but when I do, the dropdown breaks completely, only listing the entire set of items in the dropdown in the inspector. (See image)I am editing line 270 of class-search-filter-generate-input.php in search-filter-pro/public/includes like so
<div<?php echo $option_attibutes_html; ?> value="<?php echo esc_attr($option->value); ?>"><?php echo $option_label; ?></div>The attached image shows the resulting output. I do not see the DIV tag even in the console.
Trevor(Private) September 28, 2020 at 12:10 pm #261027Our plugin needs for the form to use certain HTML structure, so what you are trying is unlikely to work.
Instead, use Select2 to make the select boxes. You may need to make some changes.
Go to
wp-admin->Search & Filter->Settings->Combobox ScriptChange this from
ChosentoSelect2– we’re dropping support for Chosen in v3, because it has too many issues on mobile.Next, in the form field settings, select the combobox option for each.
There is an alternate way of doing this, but this is the easiest. Now you can style the resulting select as it is not a select!
-
AuthorPosts
