-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
checkbox: Doesn't work on touch devices #1472
Comments
Looks like there is a problem(-s) with iOS and the FastClick library ( |
One possible solution, is to move Here is the monkey-patched version with project level overrides: modules.define('checkbox', ['i-bem__dom', 'jquery', 'dom'], function(provide, BEMDOM, $, dom) {
provide(BEMDOM.decl(this.name, {
/** @override */
_onChange : function() {
this.elem('control').prop('checked', this.getMod('checked'));
},
_onPointerPress : function() {
if(!this.hasMod('disabled')) {
this.bindToDoc('pointerrelease', this._onPointerRelease);
}
},
_onPointerRelease : function(e) {
this.unbindFromDoc('pointerrelease', this._onPointerRelease);
dom.contains(this.domElem, $(e.target)) && this._updateChecked();
},
_updateChecked : function() {
this.toggleMod('checked');
}
}, {
live : function() {
this.liveBindTo('pointerpress', this.prototype._onPointerPress);
return this.__base.apply(this, arguments);
}
}));
}); |
Doesn't this patching affect |
Yep, it seems, that both keyboard and |
checkbox: Doesn't work on touch devices
checkbox
doesn't work properly on touch devices, at least on iPad/iPhone under the iOS 8.3 as well as touch devices emulator in Chrome.In the checkbox example it is impossible to toggle
checked
state by tapping on the checkbox itself. While tapping on thelabel
text works as expected.See ftlabs/fastclick#351 for additional details
The text was updated successfully, but these errors were encountered: