Skip to content

Commit

Permalink
fix: works in ssr environment
Browse files Browse the repository at this point in the history
  • Loading branch information
petyosi committed Jul 7, 2023
1 parent efb4add commit a658faa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ui/ImagesPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ export const ImagesPlugin: React.FC = () => {
}

const TRANSPARENT_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
const img = document.createElement('img')
img.src = TRANSPARENT_IMAGE

function onDragStart(event: DragEvent): boolean {
const node = getImageNodeInSelection()
Expand All @@ -91,6 +89,8 @@ function onDragStart(event: DragEvent): boolean {
return false
}
dataTransfer.setData('text/plain', '_')
const img = document.createElement('img')
img.src = TRANSPARENT_IMAGE
dataTransfer.setDragImage(img, 0, 0)
dataTransfer.setData(
'application/x-lexical-drag',
Expand Down

0 comments on commit a658faa

Please sign in to comment.