From b6942e2300ef061aadde288c9b36a6450ccd504c Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 14 Apr 2015 10:11:52 -0700 Subject: [PATCH] Fix stuck-spinners in entity properties --- examples/html/entityProperties.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/html/entityProperties.html b/examples/html/entityProperties.html index 4ac1b70e33..dd5bced393 100644 --- a/examples/html/entityProperties.html +++ b/examples/html/entityProperties.html @@ -508,18 +508,22 @@ // To make this work we block the first mouseup event after the elements // received focus. If we block all mouseup events the user will not // be able to click within the selected text. + // We also check to see if the value has changed to make sure we aren't + // blocking a mouse-up event when clicking on an input spinner. var els = document.querySelectorAll("input, textarea"); for (var i = 0; i < els.length; i++) { var clicked = false; + var originalText; els[i].onfocus = function() { + originalText = this.value; this.select(); clicked = false; }; els[i].onmouseup = function(e) { - if (!clicked) { + if (!clicked && originalText == this.value) { e.preventDefault(); - clicked = true; } + clicked = true; }; } }