You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop highlighting of block when dropping on file input #2980
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.
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.
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.
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.
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.
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.
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.
@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?
Activity
neSpecc commentedon Jan 23, 2026
Probably, block selection is stacked in this case. The investigation could start from rectangleSelection.ts.
kalyanmantha-ui commentedon Jan 25, 2026
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.
moomoo-dev commentedon Jan 25, 2026
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.
kalyanmantha-ui commentedon Jan 25, 2026
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.
moomoo-dev commentedon Jan 26, 2026
Screen.Recording.2026-01-25.at.7.58.44.PM.mov
moomoo-dev commentedon Jan 26, 2026
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
moomoo-dev commentedon Jan 26, 2026
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.
kalyanmantha-ui commentedon Jan 26, 2026
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.
fix(drag-n-drop): prevent block selection on file drop (codex-team#2980)
kalyanmantha-ui commentedon Jan 28, 2026
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.
moomoo-dev commentedon Feb 2, 2026
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 ?
moomoo-dev commentedon Feb 2, 2026
@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?