fix: select range without extension on SaveAs or ExportAs

Signed-off-by: silver <s.szmajduch@posteo.de>
This commit is contained in:
silver 2025-11-24 12:47:53 +01:00
parent f9fc8efe46
commit ed6ed4986f
No known key found for this signature in database
GPG key ID: 13EA6593D35309CF

View file

@ -91,9 +91,14 @@ export default {
const extension = filename.split('.').pop()
const filenameWithoutExtension = filename.substring(0, filename.length - extension.length - 1)
this.$nextTick(() => {
const input = this.$refs.nameInput.$refs.inputField.$el.querySelector('input')
input.setSelectionRange(0, filenameWithoutExtension.length)
input.focus()
// Wait for NcTextField to fully render and populate the input value
setTimeout(() => {
const input = this.$refs.nameInput?.$refs.inputField?.$el?.querySelector('input')
if (input && input.value) {
input.focus()
input.setSelectionRange(0, filenameWithoutExtension.length)
}
}, 50)
})
},
methods: {