diff --git a/app/javascript/vue/shared/tags_modal.vue b/app/javascript/vue/shared/tags_modal.vue index b807ace37..b92f66abd 100644 --- a/app/javascript/vue/shared/tags_modal.vue +++ b/app/javascript/vue/shared/tags_modal.vue @@ -17,6 +17,7 @@
@@ -223,7 +224,11 @@ export default { this.newTagsCreated.push(parseInt(tag.id, 10)); this.addingNewTag = false; this.$nextTick(() => { - this.$refs.tagsContainer.scrollTop = this.$refs.tagsContainer.scrollHeight; + const container = this.$refs.tagsContainer; + const newTagElement = this.$el.querySelector(`#tag-${tag.id}`); + if (newTagElement) { + container.scrollTop = newTagElement.offsetTop - container.offsetTop; + } }); }).catch((e) => { if (e.response?.data?.errors) {