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

Using pointer.touch cannot be dragged under windows system #626

Closed
2 tasks done
joannazhu88 opened this issue Sep 12, 2023 · 6 comments
Closed
2 tasks done

Using pointer.touch cannot be dragged under windows system #626

joannazhu88 opened this issue Sep 12, 2023 · 6 comments
Assignees

Comments

@joannazhu88
Copy link

Describe the bug

Using pointer.touch cannot be dragged under windows system. It can be used normally on mac system
I encountered the same problem like this issue: #583

Sandbox or Video

If applicable, please provide a minimal reproduction sandbox on code sandbox. Or a video / screenshots that could help.

``
import React from 'react';
import { useSpring, animated } from '@react-spring/web';
import { useDrag } from '@use-gesture/react';

export default function Test() {
const [{ x, y }, api] = useSpring(() => ({ x: 0, y: 0 }));

const bind = useDrag(
({ down, movement: [mx, my] }) => {
console.log('drag work---->');
api.start({ x: down ? mx : 0, y: down ? my : 0, immediate: down });
},
{ pointer: { touch: true } },
);
return (
<>
<animated.div {...bind()} style={{ x, y, boxShadow: 'rgba(0, 0, 0, 0.15) 0px 1px 2px 0px' }}>
box
</animated.div>
</>
);
}
``

Information:

  • Use Gesture version: [v10.2.27]
  • Device: [ windows computer]
  • OS: [window 10]
  • Browser [google chrome]

Checklist:

  • I've read the documentation.
  • If this is an issue with drag, I've tried setting touch-action: none to the draggable element.
@joannazhu88
Copy link
Author

joannazhu88 commented Sep 12, 2023

This function always return true in window 10 system
image

image

@dbismut
Copy link
Collaborator

dbismut commented Sep 12, 2023

Hm interesting... that kind of sucks. I'll see what I can do but I don't have much time atm.

@joannazhu88
Copy link
Author

Can you filter msMaxTouchPoints === 10 in window 10?
It is not a touch screen.
The ua is 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36'.
image
Is this information helpful?
msMaxTouchPoints is read-only,I can not modify.

@dbismut
Copy link
Collaborator

dbismut commented Sep 14, 2023

I'd like to avoid relying on user agent.

@dbismut
Copy link
Collaborator

dbismut commented Sep 16, 2023

Should be fixed in 10.3.0, can you try once again?

@joannazhu88
Copy link
Author

Thank you very much! I will try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants