Commit bed3c946 authored by Stanislav Lashmanov's avatar Stanislav Lashmanov Committed by Natalia Tepluhina

Fix scrolling to hash in MR diffs app

parent 8fc2e847
......@@ -570,12 +570,8 @@ export default {
this.scrollVirtualScrollerToIndex(index);
}
},
async scrollVirtualScrollerToIndex(index) {
scrollVirtualScrollerToIndex(index) {
this.virtualScrollCurrentIndex = index;
await this.$nextTick();
this.virtualScrollCurrentIndex = -1;
},
scrollVirtualScrollerToDiffNote() {
const id = window?.location?.hash;
......@@ -701,7 +697,7 @@ export default {
</dynamic-scroller-item>
</template>
</pre-renderer>
<virtual-scroller-scroll-sync :index="virtualScrollCurrentIndex" />
<virtual-scroller-scroll-sync v-model="virtualScrollCurrentIndex" />
</template>
</dynamic-scroller>
<template v-else>
......
......@@ -2,6 +2,9 @@ import { handleLocationHash } from '~/lib/utils/common_utils';
export default {
inject: ['vscrollParent'],
model: {
prop: 'index',
},
props: {
index: {
type: Number,
......@@ -39,6 +42,7 @@ export default {
methods: {
scrollToIndex(index) {
this.vscrollParent.scrollToItem(index);
this.$emit('update', -1);
setTimeout(() => {
handleLocationHash();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment