|
@@ -1274,7 +1274,12 @@ let offsetTop = 0;
|
|
|
*/
|
|
|
export const scrollViewNote = () => {
|
|
|
// const cursorElement = document.getElementById("cursorImg-0")!;
|
|
|
- const cursorElement: any = document.querySelector(`.noteIndex_${state.activeNoteIndex}`)!;
|
|
|
+ const noteId = state.times[state.activeNoteIndex].id;
|
|
|
+ if (!noteId) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const domId = "vf" + noteId;
|
|
|
+ const cursorElement: any = document.querySelector(`[data-vf=${domId}]`)?.parentElement;
|
|
|
const musicAndSelection = document.getElementById(state.scrollContainer)!;
|
|
|
// console.log('滑动',cursorElement.offsetTop,offsetTop, cursorElement, )
|
|
|
if (!cursorElement || !musicAndSelection || offsetTop === cursorElement.offsetTop || Math.abs(offsetTop - cursorElement.offsetTop) < 30) return;
|