Skip to content

Commit

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

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

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

Expand All @@ -14,6 +14,10 @@ export default function BannerBg({ debug }: BannerBgProps) {
y: number;
} | null>();

useLayoutEffect(() => {
window.scrollTo(0, 0);
}, []);

useEffect(() => {
// TODO: debounce
const handleOrientation = (event: DeviceOrientationEvent) => {
Expand Down

0 comments on commit e105c2d

Please sign in to comment.