mirror of
https://github.com/nextcloud/richdocuments.git
synced 2025-12-18 05:20:43 +01:00
fix: select range without extension on SaveAs or ExportAs
Signed-off-by: silver <s.szmajduch@posteo.de>
This commit is contained in:
parent
f9fc8efe46
commit
ed6ed4986f
1 changed files with 8 additions and 3 deletions
|
|
@ -91,9 +91,14 @@ export default {
|
||||||
const extension = filename.split('.').pop()
|
const extension = filename.split('.').pop()
|
||||||
const filenameWithoutExtension = filename.substring(0, filename.length - extension.length - 1)
|
const filenameWithoutExtension = filename.substring(0, filename.length - extension.length - 1)
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const input = this.$refs.nameInput.$refs.inputField.$el.querySelector('input')
|
// Wait for NcTextField to fully render and populate the input value
|
||||||
input.setSelectionRange(0, filenameWithoutExtension.length)
|
setTimeout(() => {
|
||||||
input.focus()
|
const input = this.$refs.nameInput?.$refs.inputField?.$el?.querySelector('input')
|
||||||
|
if (input && input.value) {
|
||||||
|
input.focus()
|
||||||
|
input.setSelectionRange(0, filenameWithoutExtension.length)
|
||||||
|
}
|
||||||
|
}, 50)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue