mdx-editor / mdx-editor/editor

[BUG] Remove dropEffect/effectAllowed when drag is not permitted

Open
#551 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
3.7k
Forks
307
Avg merge
14h 22m
Merged PRs (30d)
5

Description

Note: this is related to PR #549, which is currently under review.

When no imageUploadHandler is provided, users are blocked from dropping file system images into the document. However, the UX still includes the (+) dropEffect. The solution should look something like:

if (event.dataTransfer) {
  event.dataTransfer.dropEffect = "none"
  event.dataTransfer.effectAllowed = "none"
}

Unfortunately, Lexical only seems to expose the DRAGOVER_COMMAND, and does not have a dragenter. I believe both are required to eliminate the effect, unless I am mistaken.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the DRAGOVER_COMMAND handling and the imageUploadHandler condition, then compare the related PR #549 under review. Verify how dragenter and dragover are exposed and make the completed behavior clear: when image uploads are unavailable, the drop UI should not advertise or permit dropping file-system images.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.