fix(refboard): restore drag-drop with fallback + React event handlers
- Add onDragOver/onDrop preventDefault on container div (React level) to always block browser default file-open behavior - Add DOM fallback in useCanvasSetup if ref is somehow null - setupDragDrop's native listeners handle the actual upload logic
This commit is contained in:
@@ -474,7 +474,7 @@ export default function Editor({ isPublicView }: EditorProps) {
|
||||
/>}
|
||||
|
||||
{/* Canvas */}
|
||||
<div ref={canvasContainerRef} style={{ flex: 1, position: 'relative', overflow: 'hidden', background: '#1e1e1e' }} onContextMenu={handleContextMenu}>
|
||||
<div ref={canvasContainerRef} style={{ flex: 1, position: 'relative', overflow: 'hidden', background: '#1e1e1e' }} onContextMenu={handleContextMenu} onDragOver={(e) => e.preventDefault()} onDrop={(e) => e.preventDefault()}>
|
||||
{/* Dot grid — behind transparent canvas */}
|
||||
{showGrid && (() => {
|
||||
const scale = canvasTransform[0] || 1;
|
||||
|
||||
Reference in New Issue
Block a user