Skip to content

Commit

Permalink
Added missing e.stopImmediatePropagation() call in tap handlers.
Browse files Browse the repository at this point in the history
Otherwise, this leaked event causes issues when this component is loaded inside a `<paper-drawer-panel>`.
PolymerElements/paper-drawer-panel#92
  • Loading branch information
John Yanarella committed Feb 8, 2017
1 parent 4f6a658 commit ed12942
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
6 changes: 4 additions & 2 deletions radium-filter-autocomplete-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<div class="value-label" title="[[_getFilterValueLabelForValue(filterValues, item)]]">
[[_getFilterValueLabelForValue(filterValues, item)]]
</div>
<iron-icon icon="cancel" on-tap="_removeValueClick"></iron-icon>
<iron-icon icon="cancel" on-tap="_removeValueTap"></iron-icon>
</div>
</template>
</div>
Expand Down Expand Up @@ -133,7 +133,9 @@
}
},

_removeValueClick: function (e) {
_removeValueTap: function (e) {
e.stopPropagation();

var valueToRemove = e.model.__data__.item;

this.value = (this.value || []).filter(function (value) {
Expand Down
4 changes: 4 additions & 0 deletions radium-filter-autocomplete.html
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@
},

_onClearIconTap: function() {
e.stopPropagation();

this.value = '';
this.cancelDebouncer('input');
this.fire('change');
Expand Down Expand Up @@ -372,6 +374,8 @@
},

_onSuggestionItemTap: function(e) {
e.stopPropagation();

var selectedSuggestion = this._suggestions[e.currentTarget.value];
this.value = selectedSuggestion.label;
this._isDirty = false;
Expand Down
6 changes: 5 additions & 1 deletion radium-filter-bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,15 @@
}.bind(this));
},

_clearAllClicked: function() {
_clearAllClicked: function(evt) {
evt.stopPropagation();

this.removeAllTerms();
},

_termClicked: function(evt) {
evt.stopPropagation();

var term = JSON.parse(evt.currentTarget.getAttribute('data-term'));
this.removeTerm(term.key, term.value);
}
Expand Down
6 changes: 4 additions & 2 deletions radium-filter-dropdown-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<template is="dom-repeat" items="[[value]]">
<div class="value-row">
<div class="value-label" title="[[_getOptionLabelForValue(options, item)]]">[[_getOptionLabelForValue(options, item)]]</div>
<iron-icon icon="cancel" on-tap="_removeValueClick"></iron-icon>
<iron-icon icon="cancel" on-tap="_removeValueTap"></iron-icon>
</div>
</template>
</div>
Expand Down Expand Up @@ -116,7 +116,9 @@
}
},

_removeValueClick: function(e) {
_removeValueTap: function(e) {
e.stopPropagation();

var valueToRemove = e.model.__data__.item;

this.value = (this.value || []).filter(function(value) {
Expand Down
4 changes: 3 additions & 1 deletion radium-filter-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@
collapse.id = 'filter' + filterIndex;
collapse.setAttribute('opened', 'true');

label.addEventListener('click', function() {
label.addEventListener('click', function(evt) {
evt.stopPropagation();

collapse.toggle();
});

Expand Down

0 comments on commit ed12942

Please sign in to comment.