From d83e034d5eddd49c3c21b318cedb17439204c52e Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Sun, 26 Feb 2023 17:26:22 -0800 Subject: [PATCH] Select model by clicking on the file icon itself Currently one has to click on the model name to select a model. Clicking on the file icon won't work and doesn't do anything. This change fixes that behavior by allowing the user to click on either the model name or the file icon to select a model. --- ui/media/js/searchable-models.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/media/js/searchable-models.js b/ui/media/js/searchable-models.js index 7be0873e..28e3e9b3 100644 --- a/ui/media/js/searchable-models.js +++ b/ui/media/js/searchable-models.js @@ -110,8 +110,9 @@ class ModelDropdown processClick(e) { e.preventDefault() - if (e.srcElement.classList.contains('model-file')) { - this.saveCurrentSelection(e.srcElement, e.srcElement.innerText, e.srcElement.dataset.path) + if (e.srcElement.classList.contains('model-file') || e.srcElement.classList.contains('fa-file')) { + const elem = e.srcElement.classList.contains('model-file') ? e.srcElement : e.srcElement.parentElement + this.saveCurrentSelection(elem, elem.innerText, elem.dataset.path) this.hideModelList() this.modelFilter.focus() this.modelFilter.select()