Click event attached to Checkbox/Radio item do work in desktop browser but doesn't work in mobile browser.
Here is generated HTML:
<div class="ui-controlgroup-controls ">
<label id="cbox-label" for="cbox1" class="ui-btn ui-corner-all ui-btn-inherit ui-btn-icon-left ui-first-child ui-last-child ui-checkbox-on">alert("handler");</label>
<input type="checkbox" name="cboxgroup" id="cbox1" value="1" data-cacheval="false">
And event logic:
Open test page in mobile browser and tap the checkbox.
Alert pops up.
Chrome 30, Fedora 19
Chrome 30, Android 4.2.2, Samsung Galaxy Ace 3
JQM - latest
JQ - 1.10.1
@polarfish on mobile devices 'click' event delegation works differently...basically it seems to only work as expected if you bind to links or inputs. If you were to bind the event to the input element, it would fire the alert.
recommending to close as not a bug.
Thanks @JoeBot0101. Agreed, closing as not a bug.
This is a bug real and it's a long standing bug, or "kinda" bug we are doing this intentionally it has to do with our handling of vclick on the label. Right now we handle this directly instead of letting it happen normally on the element. This prevents an issue with a double click event. Please see http://jsbin.com/bedoz/2/edit for given example without jQuery mobile you will see it functions on both desktop and mobile however the handler is triggered twice. This is done in this function https://github.com/jquery/jquery-mobile/blob/master/js/widgets/forms/checkboxradio.js#L171 you can see we return false at the end and trigger our own click.
I'm reopening this however its unlikely this will be fixed in the current widget the current widget is set to be replaced by the new ui checkbox radio widget which is currently under development.
Closing this the 1.5 ui widget is now in a branch and im going to close this as wont fix