@@ -17,20 +17,6 @@ export const DesignPreview = ( {
1717} ) => {
1818 const ref = useRef ( null )
1919
20- // Prevents scrolling using mousewheel but allows it to bubble to parent
21- const handleWheel = e => {
22- // Don't prevent default - let the event bubble up to parent
23- // But stop propagation to prevent the preview content from scrolling
24- e . stopPropagation ( )
25-
26- // Make the preview content non-scrollable
27- if ( ref . current ) {
28- ref . current . style . overflow = 'hidden'
29- // Reset scroll position to ensure content stays in place
30- ref . current . scrollTop = 0
31- }
32- }
33-
3420 const isDragging = useRef ( false )
3521 const lastY = useRef ( 0 )
3622 const lastScrollTop = useRef ( 0 )
@@ -69,9 +55,6 @@ export const DesignPreview = ( {
6955 return
7056 }
7157
72- // Add the event listener without passive: false since we're not using preventDefault
73- container . addEventListener ( 'wheel' , handleWheel )
74-
7558 container . addEventListener ( 'mousedown' , handleMouseDown )
7659 // eslint-disable-next-line @wordpress/no-global-event-listener
7760 window . addEventListener ( 'mousemove' , handleMouseMove )
@@ -80,8 +63,6 @@ export const DesignPreview = ( {
8063
8164 // Clean up the event listeners when the component unmounts.
8265 return ( ) => {
83- container . removeEventListener ( 'wheel' , handleWheel )
84-
8566 container . removeEventListener ( 'mousedown' , handleMouseDown )
8667 // eslint-disable-next-line @wordpress/no-global-event-listener
8768 window . removeEventListener ( 'mousemove' , handleMouseMove )
0 commit comments