Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bigelow <sbigelow@gitlab.com>2018-12-18 04:25:41 +0300
committerSam Bigelow <sbigelow@gitlab.com>2018-12-18 04:25:41 +0300
commit9c18798275d455c78ebdac2f1ed6d25112c558fa (patch)
tree09ce9951bee850e03229419b1d9d551a35bfc5d8 /app/assets/javascripts/diffs/components/inline_diff_view.vue
parent8b4602041cf2c4a8738a4796d78720017249249f (diff)
Utilize :key to minimize extra rerenders
The diff notes automatically focus on mount, and when using the index (as opposed to line_code) for the v-bind:key, the comment form gets unnecessarily remounted, and therefore refocused.
Diffstat (limited to 'app/assets/javascripts/diffs/components/inline_diff_view.vue')
-rw-r--r--app/assets/javascripts/diffs/components/inline_diff_view.vue2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/diffs/components/inline_diff_view.vue b/app/assets/javascripts/diffs/components/inline_diff_view.vue
index 9310e2b7ca9..e781397214d 100644
--- a/app/assets/javascripts/diffs/components/inline_diff_view.vue
+++ b/app/assets/javascripts/diffs/components/inline_diff_view.vue
@@ -49,7 +49,7 @@ export default {
:is-bottom="index + 1 === diffLinesLength"
/>
<inline-diff-comment-row
- :key="`icr-${index}`"
+ :key="`icr-${line.line_code || index}`"
:diff-file-hash="diffFile.file_hash"
:line="line"
:help-page-path="helpPagePath"