Revert "Cancel native tap events in gr-dropdown"
This reverts commit 112a9e95fa
.
This broke navigation, ie CHANGES, YOUR, etc. drop down buttons.
Bug: Issue 9344
Change-Id: I6dbe293b0343fa144e17daa95536a29a65020a43
This commit is contained in:
@@ -78,10 +78,6 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
listeners: {
|
|
||||||
tap: '_handleTap',
|
|
||||||
},
|
|
||||||
|
|
||||||
behaviors: [
|
behaviors: [
|
||||||
Gerrit.BaseUrlBehavior,
|
Gerrit.BaseUrlBehavior,
|
||||||
Gerrit.KeyboardShortcutBehavior,
|
Gerrit.KeyboardShortcutBehavior,
|
||||||
@@ -294,10 +290,5 @@
|
|||||||
_computeIsDownload(link) {
|
_computeIsDownload(link) {
|
||||||
return !!link.download;
|
return !!link.download;
|
||||||
},
|
},
|
||||||
|
|
||||||
_handleTap(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopImmediatePropagation();
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
@@ -112,21 +112,16 @@ limitations under the License.
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('non link items', () => {
|
test('non link items', () => {
|
||||||
const nativeTapHandler = sandbox.stub();
|
|
||||||
const item0 = {name: 'item one', id: 'foo'};
|
const item0 = {name: 'item one', id: 'foo'};
|
||||||
element.items = [item0, {name: 'item two', id: 'bar'}];
|
element.items = [item0, {name: 'item two', id: 'bar'}];
|
||||||
const fooTapped = sandbox.stub();
|
const fooTapped = sandbox.stub();
|
||||||
const tapped = sandbox.stub();
|
const tapped = sandbox.stub();
|
||||||
element.addEventListener('tap-item-foo', fooTapped);
|
element.addEventListener('tap-item-foo', fooTapped);
|
||||||
element.addEventListener('tap-item', tapped);
|
element.addEventListener('tap-item', tapped);
|
||||||
element.addEventListener('tap', nativeTapHandler);
|
|
||||||
flushAsynchronousOperations();
|
flushAsynchronousOperations();
|
||||||
|
|
||||||
MockInteractions.tap(element.$$('.itemAction'));
|
MockInteractions.tap(element.$$('.itemAction'));
|
||||||
assert.isTrue(fooTapped.called);
|
assert.isTrue(fooTapped.called);
|
||||||
assert.isTrue(tapped.called);
|
assert.isTrue(tapped.called);
|
||||||
assert.isFalse(nativeTapHandler.called);
|
|
||||||
|
|
||||||
assert.deepEqual(tapped.lastCall.args[0].detail, item0);
|
assert.deepEqual(tapped.lastCall.args[0].detail, item0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user