mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 03:32:26 +08:00
chore(highlights): prevent crash if unable to find target element
This commit is contained in:
parent
04a7ad8d4e
commit
a44bf7fb49
@ -350,11 +350,13 @@ export default class HighlightsListWidget extends RightPanelWidget {
|
||||
}
|
||||
}
|
||||
|
||||
if (targetElement) {
|
||||
if (targetElement && targetElement[itemIndex]) {
|
||||
targetElement[itemIndex].scrollIntoView({
|
||||
behavior: "smooth",
|
||||
block: "center"
|
||||
});
|
||||
} else {
|
||||
console.warn("Unable to find the target element in the highlights list.");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user