File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
src/components/NewMessage Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 5555 <NcButton type =" tertiary" @click =" handleDismiss" >
5656 {{ t('spreed', 'Dismiss') }}
5757 </NcButton >
58- <NcButton type =" primary" @click =" handleUpload({ caption: null, options: null})" >
58+ <NcButton ref = " submitButton " type =" primary" @click =" handleUpload({ caption: null, options: null})" >
5959 {{ t('spreed', 'Send') }}
6060 </NcButton >
6161 </div >
@@ -169,21 +169,25 @@ export default {
169169
170170 watch: {
171171 async showModal (show ) {
172- if (show && this .supportMediaCaption ) {
172+ if (show) {
173+ // Wait for modal content to be rendered
173174 await this .getContainerId ()
174- this .$nextTick (() => {
175+ if (this .supportMediaCaption ) {
176+ // Wait for NewMessage to be rendered after containerId is set
177+ await this .$nextTick ()
175178 this .$refs .newMessage ? .focusInput ()
176- })
179+ } else {
180+ this .$refs .submitButton ? .$el .focus ()
181+ }
177182 }
178183 },
179184 },
180185
181186 methods: {
182187 async getContainerId () {
183- this .$nextTick (() => {
184- // Postpone render of NewMessage until modal container is mounted
185- this .modalContainerId = ` #modal-description-${ this .$refs .modal .randId } `
186- })
188+ await this .$nextTick ()
189+ // Postpone render of NewMessage until modal container is mounted
190+ this .modalContainerId = ` #modal-description-${ this .$refs .modal .randId } `
187191 },
188192
189193 handleDismiss () {
You can’t perform that action at this time.
0 commit comments