Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
120
rated 0 times [  127] [ 7]  / answers: 1 / hits: 22363  / 13 Years ago, fri, september 9, 2011, 12:00:00

Tapping on <label> does not auto-focus linked in Mobile Safari but If an empty function as clickhandler is defined
like this



document.getElementById(test_label).onclick = function () {};


solves the problem.



This is the full source code.



<body>
<input type=checkbox id=test name=test>
<label for=test id=test_label>This is the label</label>
<script>
document.getElementById(test_label).onclick = function () {};
</script>
</body>


Do you know why it works?


More From » ios

 Answers
268

It looks like you found a bug in iOS Safari. Congratulations! Finding and reporting bugs is addictive.



You can report this and other bugs to Apple at https://bugreport.apple.com/. Apple might not follow up immediately, but at some point in the future they should notify you that it was a duplicate of an existing bug, that they don’t consider it a bug, or (if you’re lucky) that you should test it again in a new version of iOS.



In the mean time, hold onto this workaround — you’ll need it.


[#90186] Wednesday, September 7, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
janayr

Total Points: 80
Total Questions: 80
Total Answers: 114

Location: Venezuela
Member since Sat, Aug 22, 2020
4 Years ago
janayr questions
Wed, Dec 29, 21, 00:00, 2 Years ago
Sun, Oct 31, 21, 00:00, 3 Years ago
Tue, Feb 4, 20, 00:00, 4 Years ago
;