Skip to content

feat(slide-toggle): remove Hammer.js dependency #17102

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

Merged
merged 1 commit into from
Sep 18, 2019

Conversation

crisbeto
Copy link
Member

Removes the slide toggle's dependency on Hammer.js by getting rid of the dragging gestures.

Removes the slide toggle's dependency on Hammer.js by getting rid of the dragging gestures.
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 16, 2019
@crisbeto crisbeto marked this pull request as ready for review September 16, 2019 20:40
@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround target: major This PR is targeted for the next major release labels Sep 16, 2019
@jelbourn
Copy link
Member

How much work do you think it would be to use the same code for the slider and the slide-toggle to still support dragging the toggle?

@crisbeto
Copy link
Member Author

It won't be that much work, but it also won't be too much code that'll be shared. Most of it is normalizing mouse and touch events, and making sure that events are cleaned up correctly, everything else is component-specific code. That being said, I decided to remove the sliding gesture here because:

  1. I'm not sure it's that useful. The component is narrow enough (36px) that dragging on it pretty much constitutes a click already. We even had a bit of logic trying to distinguish a drag from a click so we don't fire the same events twice.
  2. We've already removed it from the MDC version and MDC don't implement it themselves.

@jelbourn
Copy link
Member

That's fair- we can see how the presubmit goes and if anyone complains.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Sep 17, 2019
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn merged commit 534b9c2 into angular:master Sep 18, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants