-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fastclick not selecting input for inline elements within a label element #60
Comments
Thank you for reporting. I think checking at least one level up is acceptable. |
After thinking about this a bit more, I think it'd make more sense to add I think that's more preferable than add adding a few more lines of code to FastClick. Would you object to this solution? |
Awesome - that's a really nice solution. Many thanks! |
It seems to work, but according to MDN, this is still experimental and has been pushed to CSS4 (https://developer.mozilla.org/en-US/docs/CSS/pointer-events). |
What about I'm not clear about if this applies or not but it also seems that this fails on Internet Exploder-based touch devices. http://caniuse.com/#search=pointer-events |
I too noticed that taps on elements inside of the Here's a demonstration of the problem: And here's a fixed version using |
It looks like the
Could it relate to the extra |
I got it after some tinkering. My label was not |
For what it's worth, I'm not sure this is an ideal solution, as the the wildcard and child selectors are among the slowest in CSS. See http://www.stevesouders.com/blog/2009/06/18/simplifying-css-selectors/ |
Google don't consider CSS performance worth worrying about to provide profiling tools (https://code.google.com/p/chromium/issues/detail?id=265486) and any solution we provide in Javascript is going to be less performant than a |
While the 'pointer-events: none' works for most users, it doesn't work well for those with "heavy" fingers, at least in my case. After seeing older users use the touch interface, in my situation they tend to make heavier taps and it seems to register doubly (to the effect of checking and rapidly unchecking just as they lift their finger). Their taps tend to be somewhere between a normal tap and a selection touch hold. Removing fast-click makes it work 100% of the time in duration between a tap and a selection hold. Do you think this is a limitation of fast-click, or am I doing something wrong? HTML: CSS:
|
@mattcg thanks man, "label > * { pointer-events: none; }" also fixed it for me. Feulf! |
@mattcg ,thanks~ |
If cursor needs to be added try like below: |
label > * { pointer-events: none; } this works for me. thx! |
thanks guys ! hours spent to find this fix (label > * { pointer-events: none; }) |
I suppose it should be pointed out that
will affect everything within the label and one may need some specific exceptions in addition to some general ones, such as links within labels:
I haven't fully tested anything though. |
…perly in iOS WebViews ftlabs/fastclick#60
/Jquery Fix/ |
so good,this is good methods |
If there is an inline element inside the label element - the targetElement.tagName isn't 'label', so the findControl function is never hit.
Perhaps check if the parent node is a label then call findControl on the parent node?
FYI using testing iOS 6.0.1
The text was updated successfully, but these errors were encountered: