From a0a014ef981ca8e04c207166be65142deffc9cf1 Mon Sep 17 00:00:00 2001 From: Nimit Suwannagate Date: Fri, 20 Oct 2017 17:55:52 +0700 Subject: [PATCH] Disable drag on INPUT SELECT and TEXTAREA Some tag like INPUT, SELECT and TEXTAREA should not be draggable. Tested on my POS Project. (Chrome on XP POS Edition in NEC POS) --- dragscroll.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dragscroll.js b/dragscroll.js index fd1cf8f..60dd246 100644 --- a/dragscroll.js +++ b/dragscroll.js @@ -43,6 +43,13 @@ (cont = el.container || el)[addEventListener]( mousedown, cont.md = function(e) { + if (e.target.tagName === "SELECT" + || e.target.tagName === "INPUT" + || e.target.tagName === "TEXTAREA" + ) { + return true + } + if (!el.hasAttribute('nochilddrag') || _document.elementFromPoint( e.pageX, e.pageY