ember-gestures icon indicating copy to clipboard operation
ember-gestures copied to clipboard

swipe stops working if DOM is changed

Open lifeinafolder opened this issue 8 years ago • 0 comments

I have a component like the following:

import Ember from 'ember';
import RecognizerMixin from 'ember-gestures/mixins/recognizers';

export default Ember.Component.extend(RecognizerMixin, {
  recognizers: 'swipe',
  isContentInViewport: false,

  swipeRight() {
    this.set('isContentInViewport', true);
  },

  swipeLeft() {
    this.set('isContentInViewport', true);
  }
});
<div class="{{if isContentInViewport 'is-content-in-viewport'}} content">
  <div class="title">{{page.title}}</div>
</div>

The first swipe works perfectly. However, after the first swipe and as soon as I set the property which leads to a DOM re-render, swipe stops working.

What am I missing?

lifeinafolder avatar Mar 15 '17 05:03 lifeinafolder