mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Merge pull request #44851 from nextcloud/backport/44847/stable28
[stable28] fix(files): Focus filename input in new-node dialog when opened
This commit is contained in:
commit
7e14335d46
3 changed files with 21 additions and 4 deletions
|
|
@ -128,14 +128,31 @@ export default defineComponent({
|
|||
defaultName() {
|
||||
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() {
|
||||
// on mounted lets use the unique name
|
||||
this.localDefaultName = this.uniqueName
|
||||
this.$nextTick(() => (this.$refs.input as unknown as ICanFocus)?.focus?.())
|
||||
this.$nextTick(() => this.focusInput())
|
||||
},
|
||||
methods: {
|
||||
t,
|
||||
|
||||
/**
|
||||
* Focus the filename input field
|
||||
*/
|
||||
focusInput() {
|
||||
if (this.open) {
|
||||
this.$nextTick(() => (this.$refs.input as unknown as ICanFocus)?.focus?.())
|
||||
}
|
||||
},
|
||||
|
||||
onCreate() {
|
||||
this.$emit('close', this.localDefaultName)
|
||||
},
|
||||
|
|
|
|||
4
dist/files-init.js
vendored
4
dist/files-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-init.js.map
vendored
2
dist/files-init.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue