Open priyanshusaini105 opened 1 year ago
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
Same here, no updates on this problem?
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
I tried this too