Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/components/BreakoutRoomsEditor/SendMessageDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<template>
<NcDialog
:id="dialogMaskId"
ref="dialog"
:name="dialogTitle"
closeOnClickOutside
Expand All @@ -25,6 +26,7 @@

<script>
import { t } from '@nextcloud/l10n'
import { useId } from 'vue'
import NcDialog from '@nextcloud/vue/components/NcDialog'
import NewMessage from '../NewMessage/NewMessage.vue'

Expand Down Expand Up @@ -66,15 +68,17 @@ export default {

emits: ['close', 'submit'],

data() {
setup() {
const dialogMaskId = `new-message-upload-${useId()}`
const modalContainerId = '#' + dialogMaskId

return {
modalContainerId: null,
dialogMaskId,
modalContainerId,
}
},

mounted() {
// Postpone render of NewMessage until modal container is mounted
this.modalContainerId = '#' + this.$refs.dialog.$el.querySelector('.modal-container')?.id
this.$nextTick(() => {
this.$refs.newMessage.focusInput()
})
Expand Down
7 changes: 1 addition & 6 deletions src/components/NewMessage/NewMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,13 @@

<NcRichContenteditable
ref="richContenteditable"
:key="container"
v-model="text"
:class="{ 'new-message-form__input-rich--required': errorMessage }"
:title="errorMessage"
:autoComplete="autoComplete"
:disabled="disabled"
:userData="userData"
:menuContainer="containerElement"
:menuContainer="container"
:placeholder="placeholderText"
:aria-label="placeholderText"
:dir="text ? 'auto' : undefined"
Expand Down Expand Up @@ -646,10 +645,6 @@ export default {
return this.text.trim() !== ''
},

containerElement() {
return document.querySelector(this.container)
},

isOneToOne() {
return this.conversation.type === CONVERSATION.TYPE.ONE_TO_ONE
|| this.conversation.type === CONVERSATION.TYPE.ONE_TO_ONE_FORMER
Expand Down
3 changes: 1 addition & 2 deletions src/components/NewMessage/NewMessageUploadEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ export default {
},

setup() {
const modalContainerId = ref(null)
const isDraggingOver = ref(false)
const dialogMaskId = `new-message-upload-${useId()}`
const dialogHeaderId = `new-message-upload-header-${useId()}`
const modalContainerId = '#' + dialogMaskId

return {
modalContainerId,
Expand Down Expand Up @@ -178,7 +178,6 @@ export default {
if (show) {
// Wait for modal content to be rendered
await this.$nextTick()
this.modalContainerId = `#${this.dialogMaskId}`
if (this.supportMediaCaption) {
this.$refs.newMessage.focusInput()
} else {
Expand Down