Commit 3f77252c authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/disableVirtualScrollerFindOnPage' into 'master'

Disables diffs virtual scrolling when using find on page

See merge request gitlab-org/gitlab!66271
parents b8284323 13aa3daa
...@@ -172,6 +172,7 @@ export default { ...@@ -172,6 +172,7 @@ export default {
treeWidth, treeWidth,
diffFilesLength: 0, diffFilesLength: 0,
virtualScrollCurrentIndex: -1, virtualScrollCurrentIndex: -1,
disableVirtualScroller: false,
}; };
}, },
computed: { computed: {
...@@ -504,12 +505,17 @@ export default { ...@@ -504,12 +505,17 @@ export default {
this.moveToNeighboringCommit({ direction: 'previous' }), this.moveToNeighboringCommit({ direction: 'previous' }),
); );
} }
Mousetrap.bind(['ctrl+f', 'command+f'], () => {
this.disableVirtualScroller = true;
});
}, },
removeEventListeners() { removeEventListeners() {
Mousetrap.unbind(keysFor(MR_PREVIOUS_FILE_IN_DIFF)); Mousetrap.unbind(keysFor(MR_PREVIOUS_FILE_IN_DIFF));
Mousetrap.unbind(keysFor(MR_NEXT_FILE_IN_DIFF)); Mousetrap.unbind(keysFor(MR_NEXT_FILE_IN_DIFF));
Mousetrap.unbind(keysFor(MR_COMMITS_NEXT_COMMIT)); Mousetrap.unbind(keysFor(MR_COMMITS_NEXT_COMMIT));
Mousetrap.unbind(keysFor(MR_COMMITS_PREVIOUS_COMMIT)); Mousetrap.unbind(keysFor(MR_COMMITS_PREVIOUS_COMMIT));
Mousetrap.unbind(['ctrl+f', 'command+f']);
}, },
jumpToFile(step) { jumpToFile(step) {
const targetIndex = this.currentDiffIndex + step; const targetIndex = this.currentDiffIndex + step;
...@@ -622,7 +628,7 @@ export default { ...@@ -622,7 +628,7 @@ export default {
<div v-if="isBatchLoading" class="loading"><gl-loading-icon size="lg" /></div> <div v-if="isBatchLoading" class="loading"><gl-loading-icon size="lg" /></div>
<template v-else-if="renderDiffFiles"> <template v-else-if="renderDiffFiles">
<dynamic-scroller <dynamic-scroller
v-if="isVirtualScrollingEnabled" v-if="!disableVirtualScroller && isVirtualScrollingEnabled"
ref="virtualScroller" ref="virtualScroller"
:items="diffs" :items="diffs"
:min-item-size="70" :min-item-size="70"
......
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