PolymerElements / iron-selector

Manages a list of elements that can be selected
32 stars 55 forks source link

Add back event listener onAttach (after it was removed by onDetach) #64

Closed ronnyroeller closed 8 years ago

ronnyroeller commented 8 years ago

Description of the issue: https://github.com/PolymerElements/iron-selector/issues/24

johnheroy commented 8 years ago

Can you add a call to _removeListener before _addListener in the attached callback as so?

attached: function() {
  this._observer = this._observeItems(this);
  this._contentObserver = this._observeContent(this);
  this._removeListener(this.activateEvent);
  this._addListener(this.activateEvent);
},

I found that your PR as-is doubles the tap handlers in certain cases so would call the tap handler function twice. Maybe it would also fix the tests?

ronnyroeller commented 8 years ago

Thanks for pointing out the issue, johnheroy. I updated the Pull Request.

cdata commented 8 years ago

It looks like this branch needs to be rebased.

ronnyroeller commented 8 years ago

Thanks for the feedback.

@cdata I added the regression test and rebased the branch.

cdata commented 8 years ago

@ronnyroeller Thanks again for the contribution. Unfortunately, the ultimate design has a few moving parts so we are going to merge it in #70 . I'm gonna close out this PR.

ronnyroeller commented 8 years ago

Perfect. Thanks a lot for taking over, @cdata !