Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upcheckbox: Doesn't work on touch devices #1472
Comments
This comment has been minimized.
This comment has been minimized.
Looks like there is a problem(-s) with iOS and the FastClick library ( |
This comment has been minimized.
This comment has been minimized.
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);
}
}));
});
|
This comment has been minimized.
This comment has been minimized.
Doesn't this patching affect |
This comment has been minimized.
This comment has been minimized.
Yep, it seems, that both keyboard and |
Closed
tadatuta
added a commit
that referenced
this issue
Jun 1, 2015
checkbox: Doesn't work on touch devices
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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