Fix pasting text into task comments or task descriptions
This commit is contained in:
parent
ecefa3c892
commit
4d998d891e
2 changed files with 9 additions and 8 deletions
|
@ -253,14 +253,17 @@ export default {
|
||||||
this.$nextTick(this.renderPreview)
|
this.$nextTick(this.renderPreview)
|
||||||
},
|
},
|
||||||
text(newVal, oldVal) {
|
text(newVal, oldVal) {
|
||||||
if (oldVal === '') {
|
// Only bubble the new value if it actually changed, but not if the component just got mounted and the text changed from the outside.
|
||||||
|
if (oldVal === '' && this.text === this.value) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.bubble()
|
this.bubble()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
beforeMount() {
|
mounted() {
|
||||||
this.text = this.value
|
if (this.value !== '') {
|
||||||
|
this.text = this.value
|
||||||
|
}
|
||||||
|
|
||||||
if (this.previewIsDefault && this.hasPreview) {
|
if (this.previewIsDefault && this.hasPreview) {
|
||||||
this.$nextTick(this.renderPreview)
|
this.$nextTick(this.renderPreview)
|
||||||
|
@ -293,7 +296,7 @@ export default {
|
||||||
|
|
||||||
this.changeTimeout = setTimeout(() => {
|
this.changeTimeout = setTimeout(() => {
|
||||||
this.$emit('input', this.text)
|
this.$emit('input', this.text)
|
||||||
this.$emit('change')
|
this.$emit('change', this.text)
|
||||||
}, timeout)
|
}, timeout)
|
||||||
},
|
},
|
||||||
replaceAt(str, index, replacement) {
|
replaceAt(str, index, replacement) {
|
||||||
|
|
|
@ -168,9 +168,7 @@ export default {
|
||||||
name: 'comments',
|
name: 'comments',
|
||||||
components: {
|
components: {
|
||||||
editor: () => ({
|
editor: () => ({
|
||||||
component: import(
|
component: import(/* webpackChunkName: "editor" */ '../../input/editor'),
|
||||||
/* webpackChunkName: "editor" */ '../../input/editor'
|
|
||||||
),
|
|
||||||
loading: LoadingComponent,
|
loading: LoadingComponent,
|
||||||
error: ErrorComponent,
|
error: ErrorComponent,
|
||||||
timeout: 60000,
|
timeout: 60000,
|
||||||
|
@ -233,7 +231,7 @@ export default {
|
||||||
loadComments() {
|
loadComments() {
|
||||||
this.taskCommentService
|
this.taskCommentService
|
||||||
.getAll({taskId: this.taskId})
|
.getAll({taskId: this.taskId})
|
||||||
.then((r) => {
|
.then(r => {
|
||||||
this.$set(this, 'comments', r)
|
this.$set(this, 'comments', r)
|
||||||
this.makeActions()
|
this.makeActions()
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue