-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Momentum drawer #55
Momentum drawer #55
Conversation
} | ||
}, | ||
|
||
_trackHandler: function(event) { | ||
if (!this.persistent) { | ||
// Disable user selection. | ||
event.preventDefault(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think calling preventDefault
on track
event can prevent selection. Usually you will need to call peventDefault on down
(or mousedown) event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work at least when dragging the drawer horizontally on desktop (can still select when dragging vertically). I don't want to disable user selection altogether, but I found that the selection is causing a repaint when I close the drawer on desktop.
I'll update the comment above to specify that this is for desktop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good
this._startTimeStamp = performance.now(); | ||
|
||
// Track handler takes precedence over scrim tap handler. | ||
this.cancelDebouncer('_scrimTapHandler'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this might not be necessary, same as line 263. The track event should automatically prevent tap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not, at least on Chrome mobile :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blasten is right. The track
event should automatically prevent tap
. I did a simple test on Chrome mobile and it seems to do what I expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I could reproduce what @keanulee was seeing. Sounds like a bug in polymer gestures.
track: '_trackHandler' | ||
track: '_track', | ||
transitionEnd: '_transitionEnd', | ||
webkitTransitionEnd: '_transitionEnd' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think we need webkitTransitionEnd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed for Safari :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to lowercase the event name transitionend
and it should work on Chrome, Safari and other supported browsers.
transitionend: '_transitionEnd'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you're right. Thanks.
LGTM |
Some unrelated tests are flaking, but ready to merge now.
@frankiefu @blasten