Skip to content

Loading…

Need Polymer.Base.unlisten to remove the event listener #1639

Closed
frankiefu opened this Issue · 1 comment

3 participants

@frankiefu
Owner

Currently we have Polymer.Base.listen to add an event listener e.g. tap. But we also need Polymer.Base.unlisten to remove the event listener.

@frankiefu
Owner

This is needed for cases like in iron-selector which wants to default activateEvent to tap (https://github.com/PolymerElements/iron-selector/blob/master/iron-selectable.html#L64). But user of iron-selector may choose to have activateEvent set to something else like down, up or ''. We need a way to remove the default tap event.

@frankiefu frankiefu referenced this issue in PolymerElements/iron-selector
Merged

Use tap event #23

@kevinpschaaf kevinpschaaf added the p2 label
@azakus azakus was assigned by kevinpschaaf
@azakus azakus referenced this issue from a commit
@azakus azakus Add `unlisten` function
Keep generated event handlers, attach with WeakMap to host element
Add tests for events

Fixes #1639
8407992
@azakus azakus referenced this issue from a commit
@azakus azakus Add `unlisten` function
Keep generated event handlers, attach with WeakMap to host element
Add tests for events

Support multi-dispatch unlisten (must give event name and handler function
name).

Fixes #1639
4616576
@kevinpschaaf kevinpschaaf closed this in #1740
@vsimonian vsimonian referenced this issue from a commit in vsimonian/iron-selector
@vsimonian vsimonian Enable _removeListener after Polymer/polymer#1740
Polymer/polymer#1740 adds `unlisten` functionality, thus fixing blocking issue Polymer/polymer#1639. Now `iron-selector` can properly remove the event listener for the old activate event when it is changed instead of being forced to ignore unwanted calls handler calls.
d8ed602
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.