diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 27de15dea0b..bb5d643e93d 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -320,7 +320,7 @@ const Footer = ({ lastDeployLocaleTimestamp }: FooterProps) => { diff --git a/src/components/ui/buttons/Button.tsx b/src/components/ui/buttons/Button.tsx index 400eb6fc2de..a9faf4289b0 100644 --- a/src/components/ui/buttons/Button.tsx +++ b/src/components/ui/buttons/Button.tsx @@ -105,7 +105,7 @@ const Button = React.forwardRef( ref ) => { const handleOnClick = (e: React.MouseEvent) => { - toId && scrollIntoView(toId) + toId && scrollIntoView("#" + toId) customEventOptions && trackCustomEvent(customEventOptions) onClick?.(e) diff --git a/src/lib/utils/scrollIntoView.ts b/src/lib/utils/scrollIntoView.ts index 879e3252f04..b7e448c3fb3 100644 --- a/src/lib/utils/scrollIntoView.ts +++ b/src/lib/utils/scrollIntoView.ts @@ -1,8 +1,8 @@ export const scrollIntoView = ( - toId: string, + selector: string, options: ScrollIntoViewOptions = { behavior: "smooth", block: "start" } ): void => { - const element = document.getElementById(toId) + const element = document.querySelector(selector) if (!element) return