소스 검색

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 1 개월 전
부모
커밋
33c4ddd640
No account linked to committer's email address
3개의 변경된 파일21개의 추가작업 그리고 4개의 파일을 삭제
  1. 18
    1
      apps/files/src/components/NewNodeDialog.vue
  2. 2
    2
      dist/files-init.js
  3. 1
    1
      dist/files-init.js.map

+ 18
- 1
apps/files/src/components/NewNodeDialog.vue 파일 보기

@@ -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)
},

+ 2
- 2
dist/files-init.js
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 1
- 1
dist/files-init.js.map
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


Loading…
취소
저장