gfranko / jquery.selectBoxIt.js

A jQuery Select Box Plugin for Mobile, Tablet, and Desktop
http://www.selectboxit.com
MIT License
852 stars 301 forks source link

Disabled select box is hidden on mobile devices after calling refresh #353

Open andrewbonnington opened 8 years ago

andrewbonnington commented 8 years ago

On mobile devices when the select box is disabled the .selectboxit-rendering class is added but this isn't removed when the select box is destroyed. This leaves the select box hidden off the page if it reinitialised as this class is copied to the new select box elements.

When refresh is called the select box is destroyed and then recreated. The attributes on the select box are reset but the classes are not. As this class is added to the select box directly it is then copied to the dropdown span meaning that the whole select box is hidden.

This issue can be replicated using the iPad User Agent via Chrome emulation.

Here's a JsBin showing an example of the issue. I am calling refresh on each of the select boxes, the last three of which are disabled. When viewing this with a mobile user agent the middle two select boxes are hidden. With the final one I am removing .selectboxit-rendering after calling the destroy method solving the issue.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28613565-disabled-select-box-is-hidden-on-mobile-devices-after-calling-refresh?utm_campaign=plugin&utm_content=tracker%2F23157&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F23157&utm_medium=issues&utm_source=github).
ertygiq commented 8 years ago

Same thing. Thank you for solution.