Property 'clientX' does not exist on type 'TouchEvent<HTMLElement | SVGElement>'.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start at the DraggableEventHandler and DraggableEvent type definitions named in the report, then inspect how mouse and touch events are represented. Determine whether the issue requires a library type/API change or usage guidance; done should provide a supported way to obtain coordinates for both event variants.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from react-grid-layout/react-draggable
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
react-grid-layout/react-draggable#784 · 4 comments · 2 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
react-grid-layout/react-draggable#782 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
react-grid-layout/react-draggable#781 · 1 comment · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
react-grid-layout/react-draggable#780 · 8 comments ·
All issues in react-grid-layout/react-draggable
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·