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 @@ -1328,12 +1328,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 @@ export default {

data() {
return {
additionalTrapElements: [],
original: undefined,
draftsPromise: Promise.resolve(),
attachmentsPromise: Promise.resolve(),
Expand Down Expand Up @@ -379,6 +381,12 @@ export default {
return this.draftsPromise
},

onEditorReady({ additionalFocusTrap }) {
if (additionalFocusTrap && this.additionalTrapElements.indexOf() === -1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indexOf without an argument? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I even tested it 🤦

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 @@ -463,7 +463,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