Skip to content

Commit

Permalink
try window scroll fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Brant Ashe committed May 28, 2024
1 parent 7e90146 commit aee3226
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/components/BgBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { useEffect, useLayoutEffect, useRef, useState } from 'react';
import { useEffect, useLayoutEffect, useState } from 'react';

// import styles from './testcomponents.module.css';

Expand All @@ -13,14 +13,8 @@ export default function TestBgBanner({ debug }: BgBannerProps) {
x: number;
y: number;
} | null>();
const ref = useRef<HTMLDivElement>(null);

useLayoutEffect(() => {
const node = ref.current;

if (node) {
node.style.top = '50svh';
}
window.scrollTo(0, 0);
}, []);

useEffect(() => {
Expand All @@ -42,7 +36,6 @@ export default function TestBgBanner({ debug }: BgBannerProps) {
return (
<>
<div
ref={ref}
style={{
display: 'flex',
alignItems: 'center',
Expand Down

0 comments on commit aee3226

Please sign in to comment.