File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
apps/web/client/src/app/_components/hero Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -13,16 +13,18 @@ export function UnicornBackground() {
1313
1414 // Handle wheel events to allow scrolling while keeping mouse interactivity
1515 const handleWheel = ( e : WheelEvent ) => {
16+ // Prevent the default to avoid double-scrolling
17+ e . preventDefault ( ) ;
1618 // Manually trigger scroll on the window
17- // This ensures scrolling works even if the canvas captures the wheel event
1819 window . scrollBy ( {
1920 top : e . deltaY ,
2021 left : e . deltaX ,
2122 behavior : 'auto' ,
2223 } ) ;
2324 } ;
2425
25- container . addEventListener ( 'wheel' , handleWheel , { passive : true } ) ;
26+ // Use passive: false so we can call preventDefault()
27+ container . addEventListener ( 'wheel' , handleWheel , { passive : false } ) ;
2628
2729 return ( ) => {
2830 container . removeEventListener ( 'wheel' , handleWheel ) ;
You can’t perform that action at this time.
0 commit comments