obsidian-image-toolkit icon indicating copy to clipboard operation
obsidian-image-toolkit copied to clipboard

Conflicting with Excalidraw plugin embeds

Open lucmos opened this issue 1 year ago • 2 comments

Hello,

Unfortunately, the excalidraw plugin and this plugin conflict.

It is not possible to open an embedded excalidraw canvas when this plugin is active: image

Is there any way to work around this?

Thanks!

lucmos avatar Jan 10 '24 18:01 lucmos

+1. Might look into fixing this myself as it completely impedes on the excalidraw workflow

itsonlyjames avatar Apr 17 '24 23:04 itsonlyjames

private isImageElement = (imgEl: HTMLImageElement): boolean => {
        return (
            imgEl &&
            'IMG' === imgEl.tagName &&
            imgEl.className !==
                'excalidraw-svg excalidraw-embedded-img excalidraw-canvas-immersive'
        )
    }

image

That fixes the issue and excalidraw now reverts to requiring a double click to open, but I wonder actually if keeping the svg image capabilities are worthwhile, for example you can zoom infinitely for clarity because it's an SVG. It just needs some tweaks to make it work correctly (render in the gallery view, and open at a larger real size).

It isn't the most sound piece of code as the class could change and I've only tested a few things, but I'm definitely thinking about opening a PR and seeing if @sissilab can help us out 👍

itsonlyjames avatar Apr 21 '24 07:04 itsonlyjames

@lucmos It seems there is not any conflict now and I'll close this thread now. Please feel free to give feedback if you still got any trouble.

sissilab avatar Jun 27 '24 07:06 sissilab

Good spot @sissilab. Confirmed it's working now on the latest Excalidraw version 🎉

I think it was fixed in this version, but eh, can't be bothered figuring out for sure!

itsonlyjames avatar Jun 27 '24 07:06 itsonlyjames

Good spot @sissilab. Confirmed it's working now on the latest Excalidraw version 🎉

I think it was fixed in this version, but eh, can't be bothered figuring out for sure!

Thank you for providing this clue. I'll keep an key on it if encountering any conflict again.

sissilab avatar Jul 02 '24 00:07 sissilab