-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(lexical-playground): draggable block #2860
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I tried the deployment on the playground. Don't think this works yet. Or am I too early here? 🤔 |
Yes, It's WIP, there is currently no drop handling. |
Hi @hustlefueled. Now it's working properly, but I haven't finished processing all the cases. |
Tested on the deployed playground and it works beautifully for paragraphs, images... move. Maybe the handle could be vertically positioned at the top instead of at the middle (not sure what other editors do). |
Works for me too now. Looks good. |
7b12c56
to
0d0f022
Compare
This PR is amazing! @LuciNyan do you plan any changes to it, otherwise can help with rebasing if needed and it should go to a playground! |
Hi @fantactuka. This PR is not yet able to be used, it has some flaws and doesn't cover all cases. I'm sorry I may not be able to fix them for a while because my baby is sick, but I'll be back as soon as I can. |
0d0f022
to
03f81b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been playing with this plugin for a bit and it's pretty awesome! Some thoughts:
- Locally, I had to add anchorEl.scrollTop to the computed top of both the drag handler and the drop target to account for scrollable containers.
- The drop action seems a little flaky. Sometimes it won't work, depending on where your mouse is when releasing the mouse.
Glad you like it! 😄 And Thank you for providing a lot of useful food for thought.
I don't quite understand. Could you give me a specific example?
I have noticed that this happens when I drag to the very end of the content and then drag down. Do you mean this scenario? If you are talking about other scenarios, Could you provide the steps to reproduce them? |
Thanks @LuciNyan for amazing feature! Any improvements can go separately, and I believe many people would be happy to play around draggable blocks |
Any ETA on when / if this implementation will be shifted to |
is this usable in the react library yet? |
This has been available for a year+ in the playground. The plugin code is available inside the playground folder in the repo. |
I can't get this plugin working in react. I tried copying the way it was done from the playground folder but it did not work. Could I get some help on how to use the DraggableBlockPlugin? |
I'm having the same issue. |
Description
Add draggable block plugin
2022-09-14.23.41.11.mov
Close: #2115