Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrapNativeOnMobile Multiselect on iPhone #22

Open
salunet opened this issue Feb 25, 2016 · 5 comments
Open

wrapNativeOnMobile Multiselect on iPhone #22

salunet opened this issue Feb 25, 2016 · 5 comments

Comments

@salunet
Copy link

salunet commented Feb 25, 2016

Multiselect doesnt work when you have 'wrapNativeOnMobile: true' as option set.

Tested on a iPhone 6 plus (iOS 9.2.1)

@inferpse
Copy link
Contributor

Good catch! This option was supposed to be used only with default tags. 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.

@zacol
Copy link

zacol commented Jan 13, 2017

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:
jcf

@inferpse
Copy link
Contributor

@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.

@zacol
Copy link

zacol commented Jan 16, 2017

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 :)

@inferpse
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants