From 79305141d168a1b95f277f5a9078ac2df929e951 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 31 Mar 2015 10:51:07 -0700 Subject: [PATCH] Fix edit.js not selecting all when tabbing between properties --- examples/html/entityProperties.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/html/entityProperties.html b/examples/html/entityProperties.html index 596bf5c9d5..1c5fd58084 100644 --- a/examples/html/entityProperties.html +++ b/examples/html/entityProperties.html @@ -210,6 +210,9 @@ disableChildren(document.getElementById("properties-list"), 'input'); } else { + var activeElement = document.activeElement; + var selected = activeElement.selectionStart == 0 && activeElement.selectionEnd == activeElement.value.length; + var properties = data.selections[0].properties; elID.innerHTML = properties.id; @@ -335,6 +338,11 @@ elLightExponent.value = properties.exponent; elLightCutoff.value = properties.cutoff; } + + if (selected) { + activeElement.focus(); + activeElement.select(); + } } } });