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

improve trackmouse to 'follow' mouse outside swipeable #67

Merged
merged 3 commits into from
May 5, 2017

Conversation

hartzis
Copy link
Collaborator

@hartzis hartzis commented Apr 14, 2017

@hartzis
Copy link
Collaborator Author

hartzis commented Apr 14, 2017

  • tests and lint passes locally

));

// track eventListener adds to trigger leter
Copy link
Collaborator Author

@hartzis hartzis Apr 18, 2017

Choose a reason for hiding this comment

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

  • fix comment spelling

src/Swipeable.js Outdated
if (cancelPageSwipe && this.props.preventDefaultTouchmoveEvent) {
e.preventDefault();
}
if (cancelPageSwipe && preventDefaultTouchmoveEvent) e.preventDefault();
Copy link
Collaborator Author

@hartzis hartzis Apr 18, 2017

Choose a reason for hiding this comment

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

  • change cancelPageSwipe to cancelablePageSwipe

// track eventListener adds to trigger leter
// idea from - https://github.com/airbnb/enzyme/issues/426#issuecomment-228601631
const map = {};
document.addEventListener = jest.fn((event, cb) => {
Copy link
Collaborator Author

@hartzis hartzis Apr 18, 2017

Choose a reason for hiding this comment

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

  • add to 'setup', beforeEach and clean up afterEach

@@ -20,5 +19,6 @@ export function createMoveTouchEventObject({ x = 0, y = 0, includeTouches = true
export function createMouseEventObject({ x = 0, y = 0 }) {
return {
...createClientXYObject(x, y),
preventDefault: jest.fn(),
Copy link
Collaborator Author

@hartzis hartzis Apr 18, 2017

Choose a reason for hiding this comment

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

  • maybe make this an arg you can pass in so we can test if preventDefault and stopPropagation were fired?
  • add test for preventDefault getting called

@hartzis hartzis merged commit 1eeb741 into master May 5, 2017
hartzis added a commit that referenced this pull request Jun 7, 2017
improve trackmouse to 'follow' mouse outside swipeable
@hartzis hartzis deleted the feature/trackmouse-improved branch June 7, 2017 22:49
@github-actions github-actions bot mentioned this pull request May 18, 2023
@paulmarsicloud paulmarsicloud mentioned this pull request Jun 1, 2023
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.

[trackMouse], End event is not fired when moving out of <Swipeable> area
1 participant