mirror of
https://github.com/nextcloud/richdocuments.git
synced 2025-12-17 21:12:14 +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 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: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue