Giter Club home page Giter Club logo

Comments (10)

jakearchibald avatar jakearchibald commented on August 29, 2024 4

Just to be safe:

(event.target || this._element).setPointerCapture(event.pointerId);

from pointer-tracker.

jakearchibald avatar jakearchibald commented on August 29, 2024 3

I think the fix will be to change:

this._element.setPointerCapture(event.pointerId);

To

event.target.setPointerCapture(event.pointerId);

Can you try that for me?

from pointer-tracker.

jakearchibald avatar jakearchibald commented on August 29, 2024

Interesting! I think I currently assume that you're preventing default if you're returning true from the start callback, but I realise this isn't enforced.

A reduced test case would certainly help!

from pointer-tracker.

MidnightDesign avatar MidnightDesign commented on August 29, 2024

I actually do return true from the start callback. It's pretty much a copy of the PinchZoom custom element from Squoosh, but transformed into a React component.

Inside the pinchable element is an SVG (rendered by React) with rects with React click handlers on them. Maybe it's a problem with the click event not being propagated to the React root?

(By the way, I'm a big fan of HTTP 203. Keep up the amazing work!)

from pointer-tracker.

jakearchibald avatar jakearchibald commented on August 29, 2024

Are you calling preventDefault too?

from pointer-tracker.

MidnightDesign avatar MidnightDesign commented on August 29, 2024

Yes, just like Squoosh.

from pointer-tracker.

MidnightDesign avatar MidnightDesign commented on August 29, 2024

If you're saying preventDefault() shouldn't be there: I've tried to remove it and it doesn't make a difference. The clicks still aren't registered.

from pointer-tracker.

MidnightDesign avatar MidnightDesign commented on August 29, 2024

That works! Thank you so much. Should I open a PR?

from pointer-tracker.

jakearchibald avatar jakearchibald commented on August 29, 2024

Yes please!

from pointer-tracker.

MidnightDesign avatar MidnightDesign commented on August 29, 2024

How should I handle the case where event.target is null? I would throw an error.

from pointer-tracker.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.