Skip to content

Commit

Permalink
button: fix blur after getting rid of fastclick
Browse files Browse the repository at this point in the history
  • Loading branch information
dfilatov committed Apr 29, 2016
1 parent 415913b commit a2eda0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bower.json
Expand Up @@ -11,7 +11,7 @@
"libs"
],
"dependencies": {
"bem-core": "3.0.0"
"bem-core": "#6c57644"
},
"devDependencies": {
"bem-pr": "~0.13.0"
Expand Down
6 changes: 6 additions & 0 deletions common.blocks/button/button.js
Expand Up @@ -93,7 +93,13 @@ provide(BEMDOM.decl({ block : this.name, baseBlock : Control }, /** @lends butto
.__base.apply(this, arguments);
},

_onMouseDown : function(e) {
e.preventDefault(); // NOTE: prevents button from being blurred at least in FF and Safari
this.unbindFrom('mousedown', this._onMouseDown);
},

_onPointerPress : function() {
this.bindTo('mousedown', this._onMouseDown);
if(!this.hasMod('disabled')) {
this._isPointerPressInProgress = true;
this
Expand Down

0 comments on commit a2eda0a

Please sign in to comment.