Skip to content

Commit

Permalink
🚸 feat(ScrollToTarget): console a warning when element not found
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem committed Jan 31, 2024
1 parent 12b0b92 commit 63e6620
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ class ScrollToTargetJSInterop {

observe(id: string) {
const el = document.getElementById(id);
if (!el) return;
if (!el) {
console.warn(`[ScrollToTarget] Element with id '${id}' not found`);
return;
}

const observer = new IntersectionObserver(
async (
Expand Down

0 comments on commit 63e6620

Please sign in to comment.