We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15a3c68 commit 2e1e541Copy full SHA for 2e1e541
barcode-scanner-api-samples/scan-multiple-barcodes/cart-builder.html
@@ -242,12 +242,14 @@ <h2>Simulated Shopping Cart</h2>
242
document.addEventListener("mouseup", () => (isDragging = false));
243
244
dragDiv.addEventListener("touchstart", (e) => {
245
+ e.preventDefault();
246
isDragging = true;
247
offsetX = e.touches[0].clientX - dragDiv.offsetLeft;
248
offsetY = e.touches[0].clientY - dragDiv.offsetTop;
249
});
250
251
document.addEventListener("touchmove", (e) => {
252
253
if (isDragging) {
254
dragDiv.style.left = `${e.touches[0].clientX - offsetX}px`;
255
dragDiv.style.top = `${e.touches[0].clientY - offsetY}px`;
0 commit comments