Skip to content

Instantly share code, notes, and snippets.



Created Dec 6, 2012
What would you like to do?
iOS hacks
/*! A fix for the iOS orientationchange zoom bug.
Script by @scottjehl, rebound by @wilto.
MIT / GPLv2 License.
// No code, check source above
* A nasty bug in iOS prevents clicking on labels
* See also:
function addSafariLabelClick() {
if (navigator.userAgent.match(/iPhone/i) ||
navigator.userAgent.match(/iPod/i) ||
navigator.userAgent.match(/iPad/i)) {
// Just an empty function should be enough to deal with this issue in iOS 5+
var labels = document.querySelectorAll('label');
for (var i=0; i<labels.length; i++) {
labels[i].addEventListener( 'click', function(){}, false);

This comment has been minimized.

Copy link
Owner Author

@ludder ludder commented Nov 4, 2016

Applying cursor:pointer to the label should have the same effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.