Forums › Forums › Search & Filter Pro › Trouble with Multi-select on mobile not showing correct results
Tagged: ajax, mobile, multi select
- This topic has 34 replies, 7 voices, and was last updated 7 years, 10 months ago by Ross.
-
Anonymous(Private) November 13, 2016 at 4:50 pm #70040
Hi Zach,
I’m having the same issue you had in October, where on the iPhone, the first option is automatically selected and submits the form. I really appreciate your work on this fix. Can you point to the spot in class-search-filter-generate-input.php where I should add the disabled optgroup?
Thanks in advance,
HilaryAnonymous(Private) November 13, 2016 at 4:56 pm #70042Already answered my own question 🙂
In case it helps anyone else, add the disabled optgroup on line 260<optgroup disabled hidden></optgroup><option<?php echo $option_attibutes_html; ?> value="<?php echo esc_attr($option->value); ?>"><?php echo $option_label; ?></option>
Anonymous(Private) November 13, 2016 at 11:54 pm #70064Spoke too soon. Adding that disabled option seems to add it to every dropdown, not just comboboxes. Which ends up adding lots of vertical space between all my options. Any ideas on how to just add one disabled option at the very top of the combobox options list?
Thanks in advance!
Anonymous(Private) November 14, 2016 at 6:10 am #70076Hilary,
I had added it at line 215 for my code, not sure if your file will look exactly the same, so here’s a few lines before and after.
<?php echo $prefix; ?><label> <?php if($accessibility_label!=""){ ?><span class="screen-reader-text"><?php echo $accessibility_label; ?></span><?php } ?> <select<?php echo $attibutes_html; ?>> <optgroup disabled hidden></optgroup> <?php foreach($input_args['options'] as $option) {
It looks like this solution will add it to all dropdowns (select) fields as well, but only once. Were you possibly adding it inside the foreach loop?
If not, maybe output the $input_args array. There’s probably an indicator, or at least the class name being added to the field, that would let you test and add the optgroup only for comboboxes.
I ended up just using comboboxes, so didn’t test beyond that. Happy to take another look if it will help.
Anonymous(Private) December 30, 2016 at 7:10 pm #79314Hey all, I’m also having some trouble with multi-select on mobile. This doesn’t happen in all of my multi-select boxes. But with the first box on this page: http://walkingadventures.com, it won’t let me select the first item (Africa). It does let me select the first item under “Season” occasionally but not predictably. Any ideas why this may be? I’m not auto submitting the form.
Also, it incorrectly lists the number of items that are selected with multi-select many times (for instance, if I have 1 item selected, many times it will say 2 items are selected).
Any insight any of you have would be awesome. Thanks!
Anonymous(Private) December 30, 2016 at 7:20 pm #79319I was using Chosen but just switched to Select2, which seems to have its own set of issues. Once I click the select box, it automatically selects the first item. It also seems to have trouble closing and can tend to refuse to close and cover up the rest of the fields in the form (when I’m selecting the “Destination” field).
-
AuthorPosts