(e: DragEvent)
| 235 | }; |
| 236 | |
| 237 | let onDrag = (e: DragEvent) => { |
| 238 | // Prevent the drag event from propagating to any parent draggables |
| 239 | e.stopPropagation(); |
| 240 | |
| 241 | if (e.clientX === state.x && e.clientY === state.y) { |
| 242 | return; |
| 243 | } |
| 244 | |
| 245 | if (typeof options.onDragMove === 'function') { |
| 246 | options.onDragMove({ |
| 247 | type: 'dragmove', |
| 248 | x: e.clientX, |
| 249 | y: e.clientY |
| 250 | }); |
| 251 | } |
| 252 | |
| 253 | state.x = e.clientX; |
| 254 | state.y = e.clientY; |
| 255 | }; |
| 256 | |
| 257 | let onDragEnd = (e: DragEvent) => { |
| 258 | // Prevent the drag event from propagating to any parent draggables |
nothing calls this directly
no outgoing calls
no test coverage detected