From 82d54b0751edba21ee962e6604099bbaf7ca4156 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 24 Oct 2020 17:23:13 +0200 Subject: [PATCH] Remove the focus of the bucket title element after saving the title --- src/store/modules/kanban.js | 2 +- src/styles/components/kanban.scss | 1 + src/views/list/views/Kanban.vue | 6 ++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/store/modules/kanban.js b/src/store/modules/kanban.js index 168b506c..25bcb0c3 100644 --- a/src/store/modules/kanban.js +++ b/src/store/modules/kanban.js @@ -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) diff --git a/src/styles/components/kanban.scss b/src/styles/components/kanban.scss index f246f8b4..8ec54168 100644 --- a/src/styles/components/kanban.scss +++ b/src/styles/components/kanban.scss @@ -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; } } diff --git a/src/views/list/views/Kanban.vue b/src/views/list/views/Kanban.vue index 831c0feb..bbffa88d 100644 --- a/src/views/list/views/Kanban.vue +++ b/src/views/list/views/Kanban.vue @@ -5,7 +5,7 @@

{{ bucket.title }}

@@ -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)