Skip to content

Commit

Permalink
change reply focus
Browse files Browse the repository at this point in the history
Co-authored-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: GretaD <gretadoci@gmail.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
GretaD and ChristophWurst committed Jan 15, 2020
1 parent b2cce62 commit 3d97d83
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/components/Composer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
name="body"
class="message-body"
:placeholder="t('mail', 'Write message …')"
:focus="isReply"
@input="onInputChanged"
></TextEditor>
<TextEditor
Expand All @@ -119,6 +120,7 @@
name="body"
class="message-body"
:placeholder="t('mail', 'Write message …')"
:focus="isReply"
@input="onInputChanged"
></TextEditor>
</div>
Expand Down Expand Up @@ -215,10 +217,6 @@ export default {
TextEditor,
},
props: {
replyTo: {
type: Object,
default: () => undefined,
},
fromAccount: {
type: Number,
default: () => undefined,
Expand Down Expand Up @@ -289,7 +287,7 @@ export default {
return this.newRecipients.concat(this.autocompleteRecipients)
},
isReply() {
return this.replyTo !== undefined
return this.to.length > 0
},
noSubject() {
return this.subjectVal === '' && this.bodyVal !== ''
Expand Down
8 changes: 8 additions & 0 deletions src/components/TextEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export default {
type: String,
default: '',
},
focus: {
type: Boolean,
default: false,
},
},
data() {
return {
Expand Down Expand Up @@ -127,6 +131,10 @@ export default {
priority: 'highest',
}
)
if (this.focus) {
logger.debug('focusing TextEditor')
editor.editing.view.focus()
}

// Set value as late as possible, so the custom schema listener is used
// for the initial editor model
Expand Down

0 comments on commit 3d97d83

Please sign in to comment.