Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Trouble with Multi-select on mobile not showing correct results

Viewing 10 posts - 11 through 20 (of 35 total)
  • Hilary Stoddard
    #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,
    Hilary

    Hilary Stoddard
    #70042

    Already 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>

    Hilary Stoddard
    #70064

    Spoke 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!

    Zach Anderson
    #70076

    Hilary,

    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.

    Hilary Stoddard
    #70179

    Zach,
    You are a lifesaver! I was in fact adding it inside the foreach loop :-/
    I really appreciate the help.
    ~Hilary

    Johannes Otto-Lübker
    #75938

    Could anyone post the final solution here ?

    Johannes Otto-Lübker
    #75942

    ok i wrote <optgroup disabled hidden></optgroup> into line 217 and it works for me!

    Thanks allot!

    Danielle
    #79314

    Hey 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!

    Trevor Moderator
    #79317

    In the plugin settings, are you using Chosen or Select2 script for comboboxes (my preference is Select2)?

    Danielle
    #79319

    I 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).

Viewing 10 posts - 11 through 20 (of 35 total)

The topic ‘Trouble with Multi-select on mobile not showing correct results’ is closed to new replies.