Skip to content

Commit 02fe82c

Browse files
tweaked pro notice on full pages and fixed scrolling
1 parent af0891b commit 02fe82c

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

src/components/design-library-list/design-preview.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,18 @@ export const DesignPreview = ( {
1717
} ) => {
1818
const ref = useRef( null )
1919

20-
// Prevents scrolling using mousewheel
20+
// Prevents scrolling using mousewheel but allows it to bubble to parent
2121
const handleWheel = e => {
22-
e.preventDefault()
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+
}
2332
}
2433

2534
const isDragging = useRef( false )
@@ -60,8 +69,8 @@ export const DesignPreview = ( {
6069
return
6170
}
6271

63-
// Add the event listener with { passive: false } to force the browser to allow preventDefault() to work.
64-
container.addEventListener( 'wheel', handleWheel, { passive: false } )
72+
// Add the event listener without passive: false since we're not using preventDefault
73+
container.addEventListener( 'wheel', handleWheel )
6574

6675
container.addEventListener( 'mousedown', handleMouseDown )
6776
// eslint-disable-next-line @wordpress/no-global-event-listener

src/components/design-library-list/editor.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,23 @@
199199
}
200200
}
201201
}
202+
203+
// Full page previews
204+
.ugb-modal-design-library__full-pages {
205+
.stk--design-preview-large {
206+
cursor: grab;
207+
cursor: -webkit-grab;
208+
&.is-grabbing {
209+
cursor: grabbing;
210+
cursor: -webkit-grabbing;
211+
}
212+
}
213+
.ugb-design-control-pro-note {
214+
top: auto;
215+
padding: 60px 30px 30px;
216+
background: linear-gradient(180deg, transparent, #fffe 40px, #fff) !important;
217+
}
218+
.stk-block-design__host {
219+
opacity: 1 !important;
220+
}
221+
}

0 commit comments

Comments
 (0)