Skip to content

Commit

Permalink
Merge pull request #17466 from hujambo-dunia/fix-autoselect-file-field
Browse files Browse the repository at this point in the history
Fix for a regression change - auto-select/highlight file name text
  • Loading branch information
martenson authored Feb 15, 2024
2 parents 8c52b92 + 9c41e17 commit a41b578
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion client/src/components/Upload/DefaultRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ 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";
import UploadSettings from "./UploadSettings.vue";
library.add(faEdit, faLaptop, faFolderOpen);
const fileField = ref(null);
const props = defineProps({
deferred: {
type: Boolean,
Expand Down Expand Up @@ -104,6 +106,14 @@ function removeUpload() {
emit("remove", props.index);
}
}
onMounted(() => {
autoSelectFileInput();
});
function autoSelectFileInput() {
fileField.value.select();
}
</script>

<template>
Expand All @@ -115,6 +125,7 @@ function removeUpload() {
<FontAwesomeIcon v-if="fileMode == 'url'" icon="fa-folder-open" fixed-width />
</div>
<b-input
ref="fileField"
:value="fileName"
class="upload-title p-1 border rounded"
:disabled="isDisabled"
Expand Down

0 comments on commit a41b578

Please sign in to comment.