HTML Element Drag&Drop not working anymore in Cef
Hi!
I've noticed that our Cef based plugins started to break (iirc starting with IDEA 2024). We are using a FileEditor delegating to a JBCefBrowser (or rather it's component) to embed a form builder into the IDE. It does work, but the Editor uses TinyMCE for it's elements - which need to be drag-and-dropped onto/into it's respective container. To be noted, it's not about dropping something into the Editor-View but rather Elements inside that have to be dragged around.
For example alert/confirm, started to fail - which seems to be due to an update in the underlying chromium engine - though I could fix that quite easily using an CefJSDialogHandler and delegating to the DialogBuilder.
But I can't find the reason why drag and drop does not work (anymore). When inspecting the frame using the chrome inspector on it's debug port, I can actually drag and drop without any issues. In intelliJ itself, the elements don't drop anywhere, I can't see the blue marker lines and the element just disappears from the component sidebar (though that's most likely just TinyMCE handling unsuccessful drops). I can't really update TinyMCE either - due to only having the minified and production-ready angular code.
I did stumble upon https://intellij-support.jetbrains.com/hc/en-us/community/posts/4408960299026 - but failed to find any updates on that one.
Is it possible to know which version of chromium / cef is used to kind of pin-point potential changelogs? I couldn't find anything relevant in the console as well.
Please sign in to leave a comment.
Hi Pierre,
Currently the browser is run in OSR(off-screen-rendering) mode by default. The Drag&Drop is not supported in OSR yet.
JBR-7399 JCEF: Support drag and drop in OSR
As a temporary solution I can offer disabling OSR using
JBCefBrowserBuilder#setOffScreenRendering
or by the JVM option-Dide.browser.jcef.osr.enabled=false
Hi Vladimir,
Thank you!
JBCefBrowserBuilder#setOffScreenRendering
works flawlessly :)