From aeb56ff22a7b56af8634155fdb10a41437ee2513 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Thu, 14 Mar 2019 01:08:11 +0100 Subject: [PATCH] EntityList -> re-focus the rename field rather then re-selecting the text fully EntityProperties -> ignore selection updates when nothing is changed and window is focused --- scripts/system/html/js/entityList.js | 4 ++-- scripts/system/html/js/entityProperties.js | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/system/html/js/entityList.js b/scripts/system/html/js/entityList.js index 8482591771..b15c4e6703 100644 --- a/scripts/system/html/js/entityList.js +++ b/scripts/system/html/js/entityList.js @@ -459,7 +459,7 @@ function loaded() { isRenameFieldBeingMoved = true; document.body.appendChild(elRenameInput); // keep the focus - elRenameInput.select(); + elRenameInput.focus(); } } @@ -475,7 +475,7 @@ function loaded() { elCell.innerHTML = ""; elCell.appendChild(elRenameInput); // keep the focus - elRenameInput.select(); + elRenameInput.focus(); isRenameFieldBeingMoved = false; } diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index 863168d7fd..f501df7933 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -3325,6 +3325,13 @@ function loaded() { } let hasSelectedEntityChanged = lastEntityID !== '"' + selectedEntityProperties.id + '"'; + + if (!hasSelectedEntityChanged && document.hasFocus()) { + // in case the selection has not changed and we still have focus on the properties page, + // we will ignore the event. + return; + } + let doSelectElement = !hasSelectedEntityChanged; // the event bridge and json parsing handle our avatar id string differently.