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
3 changes: 2 additions & 1 deletion src/components/Composer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1322,12 +1322,13 @@ export default {
this.saveDraftDebounced()
},

onEditorReady(editor) {
onEditorReady({ editor, additionalFocusTrap }) {
this.bodyVal = editor.getData()
this.insertSignature()
if (this.smartReply) {
this.bus.emit('append-to-body-at-cursor', this.smartReply)
}
this.$emit('editor-ready', { editor, additionalFocusTrap })
},

onEditorSubmit(editor) {
Expand Down
8 changes: 8 additions & 0 deletions src/components/NewMessageModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
@update:smime-encrypt="patchComposerData({ smimeSign: $event })"
@update:request-mdn="patchComposerData({ requestMdn: $event })"
@draft="onDraft"
@editor-ready="onEditorReady"
@discard-draft="discardDraft"
@upload-attachment="onAttachmentUploading"
@send="onSend"
Expand Down Expand Up @@ -168,6 +169,7 @@

data() {
return {
additionalTrapElements: [],
original: undefined,
draftsPromise: Promise.resolve(),
attachmentsPromise: Promise.resolve(),
Expand All @@ -183,7 +185,7 @@
changed: false,
largerModal: false,
isLargeScreen: window.innerWidth >= 1024,
additionalTrapElements: [],

Check failure on line 188 in src/components/NewMessageModal.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Duplicate key 'additionalTrapElements'. May cause name collision in script or template tag
isMaximized: false,
recipient: {
name: '',
Expand Down Expand Up @@ -383,6 +385,12 @@
return this.draftsPromise
},

onEditorReady({ additionalFocusTrap }) {
if (additionalFocusTrap && this.additionalTrapElements.indexOf(additionalFocusTrap) === -1) {
this.additionalTrapElements.push(additionalFocusTrap)
}
},

getDataForServer(data) {
const dataForServer = {
...data,
Expand Down
5 changes: 4 additions & 1 deletion src/components/TextEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,10 @@ export default {

this.bus.on('append-to-body-at-cursor', this.appendToBodyAtCursor)
this.bus.on('insert-text-block', this.insertTextBlock)
this.$emit('ready', editor)
this.$emit('ready', {
editor,
additionalFocusTrap: '.ck-body-wrapper', // For the link picker, which is appended to the HTML body
})
},

onEditorInput(text) {
Expand Down
Loading