From b489c847fd931c309f1fe00084105184849e72ed Mon Sep 17 00:00:00 2001 From: fengkx Date: Sun, 21 Feb 2021 23:23:06 +0800 Subject: [PATCH] fix: prevent lyric selection from seeking --- src/views/lyrics.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/views/lyrics.vue b/src/views/lyrics.vue index dda94d8..2d26f90 100644 --- a/src/views/lyrics.vue +++ b/src/views/lyrics.vue @@ -134,7 +134,7 @@ v-for="(line, index) in lyricWithTranslation" :key="index" :id="`line${index}`" - @click="seek(line.time)" + @click="clickLyricLine(line.time)" > @@ -275,10 +275,15 @@ export default { this.$parent.$refs.player.setProgress(value); this.$parent.$refs.player.player.seek(value); }, + clickLyricLine(value) { + if (window.getSelection().toString().length === 0) { + this.seek(value); + } + }, blurEffect(ev) { for (let i = 0; i < ev.target.children.length; i++) { const el = ev.target.children[i]; - + const distanceToCenterPercentage = Math.abs( el.getBoundingClientRect().y +