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

Doesn’t work on Safari on iPad #366

Closed martinbean closed 8 years ago

martinbean commented 8 years ago

I have a web application with select boxes replaced with selectBoxIt. Looking at the mark-up in Safari’s web inspector on desktop, I can see the plugin has initialised (as the select box is replaced with the selectBoxIt mark-up), but I can’t get to the plugin instance. Whenever I use .data('selectBox-selectBoxIt') I get the following error:

TypeError: undefined is not an object (evaluating 'this.$subCategory.data('selectBox-selectBoxIt').remove')

gfranko commented 8 years ago

Make sure you are using the latest version of the jQuery widget factory!

gabdara commented 7 years ago

same issue here, jquery ui 1.12.1

gabdara commented 7 years ago

Found the issue in my case. If you have something like:

$('.my-select').selectBoxIt();

Now the select class is duplicated and $('.my-select') will return 2 elements, span and select. So you might get undefined if you do:

$('.my-select').data('selectBox-selectBoxIt');

To make sure you get the selectBoxIt object do:

$('select.my-select').data('selectBox-selectBoxIt');