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

Fixed playground draggable block while scrolled #5839

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Legonois
Copy link

@Legonois Legonois commented Apr 5, 2024

When using the playground in a smaller window and scrolling down, it is impossible to move a node to the top node.

This fix adjusts the draggableBlockPlugin to allow the placement of a node at the root while scrolled. It was improperly calculated, as the mouseY variable is tied to the location relative to the page and not the screen.

I encountered this bug in my own build of this plugin.

When using the playground in a smaller window, and scrolling down, it is impossible to move a node to the top node.

This fix adjusts the draggableBlockPlugin to allow the placement of a node at the root while scrolled. I encountered this bug in my own build of this plugin.
Copy link

vercel bot commented Apr 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 5, 2024 9:57pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 5, 2024 9:57pm

@facebook-github-bot
Copy link
Contributor

Hi @Legonois!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@ivailop7
Copy link
Collaborator

ivailop7 commented Apr 5, 2024

Hi, could you add a short gif of the issue, I'm trying to reproduce the original problem that's solved. The fix does make sense to me. You would also need to sign the CLA.

@Legonois
Copy link
Author

Legonois commented Apr 7, 2024

Here is the GIF of the issue:
Lexical-Playground-Bug

I also signed the agreement.

Tell me if there's anything else I need to do!

@Legonois
Copy link
Author

Legonois commented Apr 7, 2024

Wait, it still doesn't solve the underlying issue. The target line gets set correctly, but it does not move the block correctly. I will be pushing a change later today

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 7, 2024
@Sahejkm
Copy link
Contributor

Sahejkm commented Apr 8, 2024

Hi @Legonois , should we add tests as well for the fix ?

@ivailop7
Copy link
Collaborator

ivailop7 commented Apr 8, 2024

Reopening until the changes from this PR are ported over to the other one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants