Skip to content

Commit

Permalink
allow touch devices to interact with autocomplete (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibarrick authored and miguelcobain committed Nov 2, 2016
1 parent 4c5a8fb commit 867cb81
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion addon/components/paper-autocomplete-trigger-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ export default BasicTrigger.extend({
}
return tabindex;
}),

addMandatoryHandlers() {
if (this.get('isTouchDevice')) {
this.element.addEventListener('touchstart', () => {
self.document.body.addEventListener('touchmove', this._touchMoveHandler);
});
this.element.addEventListener('touchend', (e) => {
this.send('handleTouchEnd', e);
});
}
this.element.addEventListener('mousedown', (e) => this.send('handleMousedown', e));
this.element.addEventListener('keydown', (e) => this.send('handleKeydown', e));
},
actions: {

handleMousedown() {
Expand Down

0 comments on commit 867cb81

Please sign in to comment.