Sfoglia il codice sorgente

Merge pull request #44847 from nextcloud/fix/files-focus-new-node-dialog

fix(files): Focus filename input in new-node dialog when opened
pull/44860/head
Ferdinand Thiessen 2 mesi fa
parent
commit
33c4ddd640
Nessun account collegato all'indirizzo email del committer

+ 18
- 1
apps/files/src/components/NewNodeDialog.vue Vedi File

defaultName() { defaultName() {
this.localDefaultName = this.defaultName || t('files', 'New folder') this.localDefaultName = this.defaultName || t('files', 'New folder')
}, },

/**
* Ensure the input is focussed even if the dialog is already mounted but not open
*/
open() {
this.$nextTick(() => this.focusInput())
},
}, },
mounted() { mounted() {
// on mounted lets use the unique name // on mounted lets use the unique name
this.localDefaultName = this.uniqueName this.localDefaultName = this.uniqueName
this.$nextTick(() => (this.$refs.input as unknown as ICanFocus)?.focus?.())
this.$nextTick(() => this.focusInput())
}, },
methods: { methods: {
t, t,

/**
* Focus the filename input field
*/
focusInput() {
if (this.open) {
this.$nextTick(() => (this.$refs.input as unknown as ICanFocus)?.focus?.())
}
},

onCreate() { onCreate() {
this.$emit('close', this.localDefaultName) this.$emit('close', this.localDefaultName)
}, },

+ 2
- 2
dist/files-init.js
File diff soppresso perché troppo grande
Vedi File


+ 1
- 1
dist/files-init.js.map
File diff soppresso perché troppo grande
Vedi File


Loading…
Annulla
Salva