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

Property 'clientX' does not exist on type 'TouchEvent<HTMLElement | SVGElement>'. #723

Open
priyanshusaini105 opened this issue Jul 14, 2023 · 1 comment

Comments

@priyanshusaini105
Copy link

Property 'clientX' does not exist on type 'DraggableEvent'.
Property 'clientX' does not exist on type 'TouchEvent<HTMLElement | SVGElement>'.

how to mention the clientX for both touch and mouse event

const onLabelDragged:DraggableEventHandler = (e) => {
    const sliderEle = sliderRef.current;
    if (sliderEle) {
      const sliderRect = sliderRef.current?.getBoundingClientRect();
      let selectedStrikeIndex = Math.floor(
        (e.clientX - sliderRect.left + sliderEle.scrollLeft) / 24 <------
      ); 
     }
  };

I tried this too

((e.clientX || e.touches[0].clientX) - sliderRect.left + sliderEle.scrollLeft) / 24
@danivalls
Copy link

Same here, no updates on this problem?

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

No branches or pull requests

2 participants