Skip to content

[lexical-playground] Bug Fix: Show draggable block target line when dragging images#8015

Merged
etrepum merged 1 commit intofacebook:mainfrom
paigekim29:fix/image-drag-target-line
Dec 10, 2025
Merged

[lexical-playground] Bug Fix: Show draggable block target line when dragging images#8015
etrepum merged 1 commit intofacebook:mainfrom
paigekim29:fix/image-drag-target-line

Conversation

@paigekim29
Copy link
Copy Markdown
Contributor

Updates the dragover event handler to correctly prevent default behavior, resolving an issue where the image drag and drop target line was not consistently displayed.

Description

Current behavior: When dragging an image in the editor, the $onDragover function in ImagesPlugin returns true, which stops the DRAGOVER_COMMAND event propagation. This prevents DraggableBlockPlugin from displaying the draggable-block-target-line indicator.
Changes in this PR: Changed $onDragover to return false instead of true, allowing the event to propagate to DraggableBlockPlugin so it can display the target line during image drag operations.

Test plan

Before

  1. Insert an image into the editor
  2. Click on the image to select it
  3. Drag the image → No target line indicator shown
Screen.Recording.2025-12-02.at.2.53.29.PM.mov

After

  1. Insert an image into the editor
  2. Click on the image to select it
  3. Drag the image → Blue target line indicator is displayed
Screen.Recording.2025-12-02.at.3.10.12.PM.mov

Updates the dragover event handler to correctly prevent default behavior, resolving an issue where the image drag and drop target line was not consistently displayed.
@vercel
Copy link
Copy Markdown

vercel bot commented Dec 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
lexical Ready Ready Preview Comment Dec 2, 2025 6:13am
lexical-playground Ready Ready Preview Comment Dec 2, 2025 6:13am

@meta-cla meta-cla 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 Dec 2, 2025
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Dec 10, 2025
Copy link
Copy Markdown
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

The target line only shows when the DraggableBlockPlugin handle is dragged, not the image itself. This seems like expected behavior, at least as far as this PR is concerned.

@etrepum etrepum added this pull request to the merge queue Dec 10, 2025
Merged via the queue into facebook:main with commit e127945 Dec 10, 2025
43 checks passed
@etrepum etrepum mentioned this pull request Dec 10, 2025
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. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants