Fix draggable number going into edit too often

This commit is contained in:
Ryan Huffman 2018-11-19 13:51:25 -08:00
parent 193b9752b8
commit 7694aa8e66

View file

@ -32,7 +32,7 @@ DraggableNumber.prototype = {
mouseUp: function(event) {
if (event.target === this.elText && this.initialMouseEvent) {
let dx = event.clientX - this.initialMouseEvent.clientX;
if (dx <= DELTA_X_FOCUS_THRESHOLD) {
if (Math.abs(dx) <= DELTA_X_FOCUS_THRESHOLD) {
this.elInput.style.visibility = "visible";
this.elText.style.visibility = "hidden";
}