Skip to content

Commit 5c25fc8

Browse files
committed
fix block jumping from minimap
1 parent ae690f1 commit 5c25fc8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

frontend/MSA.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,10 @@ export default {
554554
},
555555
handleMapBlockClick(index) {
556556
const top = document.querySelector('.minimap').offsetHeight + 64; // app-bar + minimap
557-
const box = this.$refs.msaView.$el.children[index].getBoundingClientRect();
557+
const blocks = this.$refs.msaView?.$el?.querySelectorAll?.('.msa-block-wrapper');
558+
const target = blocks && blocks[index];
559+
if (!target) return;
560+
const box = target.getBoundingClientRect();
558561
window.scrollTo({ behavior: 'smooth', top: box.top + window.scrollY - top });
559562
},
560563
handleAlphabetChange(event) {

0 commit comments

Comments
 (0)