Remove the focus of the bucket title element after saving the title
This commit is contained in:
parent
5e046fbd06
commit
82d54b0751
3 changed files with 6 additions and 3 deletions
|
@ -124,7 +124,7 @@ export default {
|
|||
.then(r => {
|
||||
ctx.commit('setBuckets', r)
|
||||
ctx.commit('setListId', listId)
|
||||
return Promise.resolve()
|
||||
return Promise.resolve(r)
|
||||
})
|
||||
.catch(e => {
|
||||
return Promise.reject(e)
|
||||
|
|
|
@ -245,6 +245,7 @@ $crazy-height-calculation: '100vh - 4.5rem - 1.5rem - 1em - 1.5em - 8px';
|
|||
.title.input {
|
||||
height: auto;
|
||||
padding: .4em .5em;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<h2
|
||||
:ref="`bucket${bucket.id}title`"
|
||||
@focusout="() => saveBucketTitle(bucket.id)"
|
||||
@keyup.ctrl.enter="() => saveBucketTitle(bucket.id)"
|
||||
@keyup.enter="() => saveBucketTitle(bucket.id)"
|
||||
class="title input"
|
||||
contenteditable="true"
|
||||
spellcheck="false">{{ bucket.title }}</h2>
|
||||
|
@ -497,7 +497,8 @@ export default {
|
|||
})
|
||||
},
|
||||
saveBucketTitle(bucketId) {
|
||||
const bucketTitle = this.$refs[`bucket${bucketId}title`][0].textContent
|
||||
const bucketTitleElement = this.$refs[`bucket${bucketId}title`][0]
|
||||
const bucketTitle = bucketTitleElement.textContent
|
||||
const bucket = new BucketModel({
|
||||
id: bucketId,
|
||||
title: bucketTitle,
|
||||
|
@ -515,6 +516,7 @@ export default {
|
|||
this.$store.dispatch('kanban/updateBucket', bucket)
|
||||
.then(r => {
|
||||
realBucket.title = r.title
|
||||
bucketTitleElement.blur()
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
|
|
Loading…
Reference in a new issue