From bfaf903e8006c9f225255355712bd0a9435ad014 Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Thu, 7 Dec 2023 21:58:51 +0000 Subject: [PATCH] Small tweak --- html/create_object.html | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/html/create_object.html b/html/create_object.html index 8e67b99aebca..53839cbf90d5 100644 --- a/html/create_object.html +++ b/html/create_object.html @@ -9,7 +9,7 @@
- Type:
Offset: @@ -66,14 +66,19 @@ populateList(filtered); } - function submitFirst(event) { - if (!object_list.options.length) { - return false; - } - + function filterKeyPressed(event) { // Carriage return if (event.keyCode == 13 || event.which == 13) { - object_list.options[0].selected = 'true'; + // If the value of the input bar is different to the previous search. + if (document.spawner.filter.value != old_search) { + // Search! + updateSearch() + } + // Otherwise, if there are entries in the object list. + else if (object_list.options.length){ + // Select and spawn the one at the top. + object_list.options[0].selected = 'true'; + } } }