vguillou / swipe-action

A Polymer element providing a declarative way to swipe DOM elements with configurable underlays and trigger some action when the swiping is done. Integrates seamlessly with the <iron-list> element.
https://vguillou.github.io/webcomponents/swipe-action
MIT License
15 stars 5 forks source link

Bug: `this._currentAction` is accessed without checking if not `undefined` first in a few places #6

Open OvermindDL1 opened 7 years ago

OvermindDL1 commented 7 years ago

In a few places this._currentAction is accessed without checking if it is null first, such as in _swipeUpdate, _swipeEnd, _applyGestureTranslation (called by _swipeStart), and _applyRubberBand (called by _applyGestureTranslation). Normally you'd think this would not be an issue, however putting <swipe-action> in a Polymer app-drawer, for example, causes the drawer being slide one way (a way that the swipe elements ignore, say the drawer is on the left and can be slid left, and the swipe-action can be swiped right) to cause the swipe-action to receive '_onTrackcallbacks, which then causes it to access anundefined`this._currentAction, thus crashing the event handling and causing exceptions in the scripts.

OvermindDL1 commented 7 years ago

Not fully tested yet, but it looks like this might also happen if a swipe is given a direction one way, but not the other (like being able to swipe left but not right), then swiping the accepted way to start a swipe, then swipe it off into the other way (like swiping left, then far right in the prior example).

vguillou commented 7 years ago

Yep there is a bug there, thanks for the report !