Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix drag preview #304

Merged
merged 4 commits into from
Jan 6, 2025
Merged

Fix drag preview #304

merged 4 commits into from
Jan 6, 2025

Conversation

lucasfcosta
Copy link
Member

Fixes the drag preview for the editor and also adds "scroll on drag".

PS: I also updated the plotly import because I was having issues with it rendering on the server side.

See plotly/react-plotly.js#272

Not sure why this started happening now though

import { CSSProperties, useEffect } from 'react'
import { useDragLayer, XYCoord } from 'react-dnd'
import IconSelector from './IconSelector'
import { ElementType } from './v2Editor'
Copy link
Member

@vieiralucas vieiralucas Dec 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is what's causing the ssr error by the way.

When you import ./v2Editor you end up importing ./customBlocks/python which imports ./PythonOutput.

Rule of thumb is, do not import stuff from v2Editor with ssr, a lot of stuff from that folder do not work with ssr.

We should probably just move ElementType to it's own file, maybe we can introduce a utils/dragndrop.ts file.

@lucasfcosta lucasfcosta merged commit f686980 into main Jan 6, 2025
2 checks passed
@lucasfcosta lucasfcosta deleted the fix-drag-preview branch January 6, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants