Skip to content

Stop highlighting of block when dropping on file input #2980

Open

Description

@moomoo-dev

Describe a bug.
I've created a drop zone to upload files. After the file is uploaded the block is highlighted blue. (In screenshot below). How do I stop this from happening ?

Expected behavior:
Uploaded photo shouldn't have the blue highlighted box around it because I don't want the block to be selected.

Screenshots:
Image

Device, Browser, OS:
Chrome

Editor.js version:
Latest version

Plugins you use with their versions:

Activity

  1. neSpecc commented on Jan 23, 2026

    @neSpecc
    Member

    Probably, block selection is stacked in this case. The investigation could start from rectangleSelection.ts.

  2. kalyanmantha-ui commented on Jan 25, 2026

    @kalyanmantha-ui

    Thanks for the pointer!

    I’d like to work on this issue. I’ll start by investigating the selection logic in rectangleSelection.ts and try to reproduce the stacked selection behavior locally.

    Please let me know if anyone else is already working on it.

  3. moomoo-dev commented on Jan 25, 2026

    @moomoo-dev
    Author

    Yeah If you want I can record a video that way you can see exactly whats happening. I have a repo that you can also probably use with my block component that does the drop and upload. Let me know.

  4. kalyanmantha-ui commented on Jan 25, 2026

    @kalyanmantha-ui

    That would be super helpful, thank you!

    A short video showing the exact behavior would be great, and I’d also be happy to take a look at the repo you mentioned if you can share it. I’ll continue investigating on my end as well.

  5. moomoo-dev commented on Jan 26, 2026

    @moomoo-dev
    Author
    Screen.Recording.2026-01-25.at.7.58.44.PM.mov
  6. moomoo-dev commented on Jan 26, 2026

    @moomoo-dev
    Author

    Here is the git repo..... npm install. then npm run dev. You can change the port in the package.json if needed

    https://github.com/moomoo-dev/table

  7. moomoo-dev commented on Jan 26, 2026

    @moomoo-dev
    Author

    At the 7 second mark you can see a arrow and line below the drop zone. I'm not sure if that is whats causing it, or is there is soemthing I can use in the api that will allow me to deselect a block manually. I would definitely just use that. I was going to manually remove the "ce-block--selected" class manually as a work around.

  8. kalyanmantha-ui commented on Jan 26, 2026

    @kalyanmantha-ui

    Thanks for sharing the repo and the extra details — that’s very helpful.

    I’ll use the demo repo to reproduce the behavior and first check whether there’s an existing selection / deselection API that can be used to properly clear the block state after drop. If not, I’ll make sure any fallback is minimal and well-contained.

    I’ll follow up once I have a clearer fix.

  9. kalyanmantha-ui commented on Jan 28, 2026

    @kalyanmantha-ui

    I have submitted a PR to fix this issue: #2981.

    The fix involves removing the forced caret placement in the dragNDrop module, which was causing the block to become selected upon drop. I've verified this manually in a reproduction environment.

  10. moomoo-dev commented on Feb 2, 2026

    @moomoo-dev
    Author

    Nice. Can't wait to see it. I have a few other ideas I would love to see if I can implement. Do y'all have a roadmap ?

  11. moomoo-dev commented on Feb 2, 2026

    @moomoo-dev
    Author

    @kalyanmantha-ui Another question. After I drop the image and it uploads.. it then creates a new block with the same type below it.. how can I default it to create a paragraph block instead duplicating the same image block?

    Is there a settings for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions