From 9c41e17454768d965f5ed34930b10daca8622943 Mon Sep 17 00:00:00 2001 From: hujambo-dunia Date: Tue, 13 Feb 2024 21:13:44 -0500 Subject: [PATCH] Fix for a regression change; Auto-select/highlight file name text in input field for usability; change was lost when not carried over to newer code platform from https://github.com/galaxyproject/galaxy/blob/release_23.1/client/src/mvc/upload/default/default-row.js#L139 --- client/src/components/Upload/DefaultRow.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/client/src/components/Upload/DefaultRow.vue b/client/src/components/Upload/DefaultRow.vue index 921b1e0c7f65..396fcb2deae6 100644 --- a/client/src/components/Upload/DefaultRow.vue +++ b/client/src/components/Upload/DefaultRow.vue @@ -3,7 +3,7 @@ import { library } from "@fortawesome/fontawesome-svg-core"; import { faEdit, faFolderOpen, faLaptop } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import { bytesToString } from "utils/utils"; -import { computed } from "vue"; +import { computed, onMounted, ref } from "vue"; import UploadExtension from "./UploadExtension.vue"; import UploadSelect from "./UploadSelect.vue"; @@ -11,6 +11,8 @@ import UploadSettings from "./UploadSettings.vue"; library.add(faEdit, faLaptop, faFolderOpen); +const fileField = ref(null); + const props = defineProps({ deferred: { type: Boolean, @@ -104,6 +106,14 @@ function removeUpload() { emit("remove", props.index); } } + +onMounted(() => { + autoSelectFileInput(); +}); + +function autoSelectFileInput() { + fileField.value.select(); +}