Linux: Fixes #16457: Fix dropping notes into the whiteboard editor (#16565)

This commit is contained in:
Henry Heino authored and GitHub committed 2026-09-19 17:03:56 +01:00
1 parent 4d36a87296
commit cbd3445de9
1 file changed
+6 -1
@@ -405,10 +405,15 @@ const InnerSurface = ({ canvas, onChange }: Props) => {
);
const onDragOver = useCallback((e: ReactDragEvent<HTMLDivElement>) => {
const effectAllowed = e.dataTransfer.effectAllowed;
const canLink = effectAllowed.toLowerCase().includes('link') || ['all', 'uninitialized'].includes(effectAllowed);
const types = Array.from(e.dataTransfer.types);
if (types.includes('text/x-jop-note-ids') || types.includes('text/x-jop-resource-ids')) {
e.preventDefault();
e.dataTransfer.dropEffect = 'link';
// Workaround: On Linux, the 'link' drag effect prevents dropping items into the editor.
// See https://github.com/laurent22/joplin/issues/16457.
e.dataTransfer.dropEffect = canLink ? 'link' : 'copy';
} else if (types.includes('Files')) {
e.preventDefault();
e.dataTransfer.dropEffect = 'copy';