jcf
jcf copied to clipboard
wrapNativeOnMobile Multiselect on iPhone
Multiselect doesnt work when you have 'wrapNativeOnMobile: true' as option set.
Tested on a iPhone 6 plus (iOS 9.2.1)
Good catch! This option was supposed to be used only with default
But we could activate it on touch devices and show select in compact mode.
Thanks for the issue, I'll check the best way to do it.
I've got the same problem here. I would like to use a native multiselect on mobiles but when I click on a JCF control, it's selecting the first option automatically, instead just open a native menu.
But this is only the beginning. Now, I can see that JCF has first value selected, but in a native menu it's not selected. If I click on this option in a native menu, it will be selected in a native menu, but now it will be unselected in JCF. And so on...
Please, look at the screen shot:
@zacol please try with current master branch - it should be resolved.
The solution is to automatically enable compact mode for multiple selects on mobile devices.
Now wrapNativeOnMobile: true
should be properly handled by mobile devices.
The bug still occurs but in your demo you couldn't reproduce it because your first option is in <optgroup>
tag (which is unselectable). If you remove all optgroups from your multiple select and then try to click on it, you will see behaviour described by me.
At least, I found a difference between your demo and my code, and now I added a temporary solution (optgroup) to my code :)
Seems like <optgroup>
is the best workaround for this iOS issue.
I've added this workaround to the master. It shouldn't affect developers which are iterating through <option>
nodes or accessing them by .options
property.
Please test without adding optgroup manually. Does it work fine in your case?