Commit 70bd90ba authored by Phil Hughes's avatar Phil Hughes

fix mouseOver & arrow keys working at same time

parent d9262b79
...@@ -24,6 +24,7 @@ export default { ...@@ -24,6 +24,7 @@ export default {
focusedIndex: 0, focusedIndex: 0,
searchText: '', searchText: '',
mouseOver: false, mouseOver: false,
cancelMouseOver: false,
}; };
}, },
computed: { computed: {
...@@ -97,6 +98,7 @@ export default { ...@@ -97,6 +98,7 @@ export default {
case UP_KEY_CODE: case UP_KEY_CODE:
e.preventDefault(); e.preventDefault();
this.mouseOver = false; this.mouseOver = false;
this.cancelMouseOver = true;
if (this.focusedIndex > 0) { if (this.focusedIndex > 0) {
this.focusedIndex -= 1; this.focusedIndex -= 1;
} else { } else {
...@@ -106,6 +108,7 @@ export default { ...@@ -106,6 +108,7 @@ export default {
case DOWN_KEY_CODE: case DOWN_KEY_CODE:
e.preventDefault(); e.preventDefault();
this.mouseOver = false; this.mouseOver = false;
this.cancelMouseOver = true;
if (this.focusedIndex < this.filteredBlobsLength - 1) { if (this.focusedIndex < this.filteredBlobsLength - 1) {
this.focusedIndex += 1; this.focusedIndex += 1;
} else { } else {
...@@ -133,8 +136,13 @@ export default { ...@@ -133,8 +136,13 @@ export default {
router.push(`/project${file.url}`); router.push(`/project${file.url}`);
}, },
onMouseOver(index) { onMouseOver(index) {
if (!this.cancelMouseOver) {
this.mouseOver = true; this.mouseOver = true;
this.focusedIndex = index; this.focusedIndex = index;
}
},
onMouseMove() {
this.cancelMouseOver = false;
}, },
}, },
}; };
...@@ -144,6 +152,7 @@ export default { ...@@ -144,6 +152,7 @@ export default {
<div <div
class="ide-file-finder-overlay" class="ide-file-finder-overlay"
@mousedown.self="toggleFileFinder(false)" @mousedown.self="toggleFileFinder(false)"
@mousemove="onMouseMove"
> >
<div <div
class="dropdown-menu diff-file-changes ide-file-finder show" class="dropdown-menu diff-file-changes ide-file-finder show"
...@@ -176,7 +185,11 @@ export default { ...@@ -176,7 +185,11 @@ export default {
@click="clearSearchInput" @click="clearSearchInput"
></i> ></i>
</div> </div>
<div> <div
:style="{
'pointer-events': cancelMouseOver ? 'none' : ''
}"
>
<virtual-list <virtual-list
:size="listHeight" :size="listHeight"
:remain="listShowCount" :remain="listShowCount"
......
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