Skip to content

Commit

Permalink
setScrollDirection after listening for track
Browse files Browse the repository at this point in the history
  • Loading branch information
keanulee committed Jun 13, 2016
1 parent 32db863 commit aabbec6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions app-drawer/app-drawer.html
Expand Up @@ -251,9 +251,6 @@
_lastTabStop: null,

ready: function() {
// Set the scroll direction so you can vertically scroll inside the drawer.
this.setScrollDirection('y');

// Only transition the drawer after its first render (e.g. app-drawer-layout
// may need to set the initial opened state which should not be transitioned).
this._setTransitionDuration('0s');
Expand All @@ -267,9 +264,12 @@
this._boundEscKeydownHandler = this._escKeydownHandler.bind(this);
this._resetDrawerState();

this.listen(this, 'track', '_track');
this.addEventListener('transitionend', this._transitionend.bind(this));
this.addEventListener('keydown', this._tabKeydownHandler.bind(this))

// Only listen for horizontal track so you can vertically scroll inside the drawer.
this.listen(this, 'track', '_track');
this.setScrollDirection('y');
});
},

Expand Down
7 changes: 5 additions & 2 deletions app-drawer/test/app-drawer.html
Expand Up @@ -116,8 +116,11 @@
assert.isFalse(drawer.noFocusTrap);
});

test('set scroll direction', function() {
assert.equal(drawer['__polymerGesturesTouchAction'], 'pan-y');
test('set scroll direction', function(done) {
window.setTimeout(function() {
assert.equal(drawer['__polymerGesturesTouchAction'], 'pan-y');
done();
}, 350);
});

test('transitions are enabled after attached', function(done) {
Expand Down

0 comments on commit aabbec6

Please sign in to comment.