Skip to content
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

Merged
merged 10 commits into from
Feb 12, 2016
Merged

Momentum drawer #55

merged 10 commits into from
Feb 12, 2016

Conversation

keanulee
Copy link
Contributor

@keanulee keanulee commented Feb 8, 2016

Some unrelated tests are flaking, but ready to merge now.

@frankiefu @blasten

}
},

_trackHandler: function(event) {
if (!this.persistent) {
// Disable user selection.
event.preventDefault();
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

@keanulee keanulee changed the title [DO NOT MERGE] Momentum drawer Momentum drawer Feb 9, 2016
this._startTimeStamp = performance.now();

// Track handler takes precedence over scrim tap handler.
this.cancelDebouncer('_scrimTapHandler');
Copy link
Contributor

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.

Copy link
Contributor Author

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 :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keanulee I recommend talking to @azakus because he told me that these two events are mutually exclusive.

Copy link
Contributor

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.

Copy link
Contributor

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'
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed for Safari :(

Copy link
Contributor

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'

Copy link
Contributor Author

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.

@frankiefu
Copy link
Contributor

LGTM

frankiefu added a commit that referenced this pull request Feb 12, 2016
@frankiefu frankiefu merged commit 9882ade into master Feb 12, 2016
@frankiefu frankiefu deleted the momentum-drawer branch February 12, 2016 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants