File tree Expand file tree Collapse file tree
apps/web/src/common/components/gallery/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,8 +46,10 @@ export const ItemComponent: React.FC<Props> = props => {
4646 getInitialData : ( ) => ( { type : item . type } ) ,
4747 onDragStart : ( ) => {
4848 setIsDragging ( true ) ;
49- const dataUrl = thumbnailDataUrlRef . current ?? item . thumbnailSrc ;
50- notifyDragStartToWebviewShell ( item . type as ShapeType , dataUrl ) ;
49+ const dataUrl = thumbnailDataUrlRef . current ;
50+ if ( dataUrl ) {
51+ notifyDragStartToWebviewShell ( item . type as ShapeType , dataUrl ) ;
52+ }
5153 } ,
5254 onDrop : ( ) => {
5355 setIsDragging ( false ) ;
@@ -57,7 +59,7 @@ export const ItemComponent: React.FC<Props> = props => {
5759 // Native drag image from the nested iframe is unreliable on macOS; the
5860 // shell paints its own preview (see drag-bridge.ts), so suppress the
5961 // native one with a 1×1 transparent element.
60- if ( shouldUseMacWebviewDragBridge ( ) ) {
62+ if ( shouldUseMacWebviewDragBridge ( ) && thumbnailDataUrlRef . current ) {
6163 setCustomNativeDragPreview ( {
6264 getOffset : ( ) => ( { x : 0 , y : 0 } ) ,
6365 render ( { container } ) {
You can’t perform that action at this time.
0 commit comments