Skip to content

Commit

Permalink
Merge pull request #1468 from OnsenUI/switch-prevent-default
Browse files Browse the repository at this point in the history
fix(ons-switch): Closes #1464.
  • Loading branch information
argelius committed Jun 20, 2016
2 parents 67e2642 + bba0294 commit 1c5c5f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@ CHANGELOG
v2.0.0-rc.12
----
* core: Added type definitions.
* ons-switch: Fix [#1464](https://github.com/OnsenUI/OnsenUI/issues/1464).

v2.0.0-rc.11
----
Expand Down
1 change: 1 addition & 0 deletions core/src/elements/ons-splitter-side.js
Expand Up @@ -160,6 +160,7 @@ class CollapseMode {
const direction = event.gesture.interimDirection;
const shouldOpen = el._side !== direction && distance > width * el._threshold;
this.executeAction(shouldOpen ? 'open' : 'close');
this._ignoreDrag = true;
}

layout() {
Expand Down
3 changes: 3 additions & 0 deletions core/src/elements/ons-switch.js
Expand Up @@ -247,6 +247,9 @@ class SwitchElement extends BaseElement {
this.classList.remove('switch--active');
return;
}

e.stopPropagation();

this.classList.add('switch--active');
this._startX = this._locations[this.checked ? 1 : 0];// - e.gesture.deltaX;

Expand Down

0 comments on commit 1c5c5f3

Please sign in to comment.