Skip to content

Exporting SVG with foreignObject causes error in tldraw 4.1.2 #7055

@kristoffer-adam-tronerud-adsk

Description

What happened?

When exporting arrows, I get these spammed in console. I'm not 100% sure what they are, but it does seem like the export I'm doing is rendering fine. I see the same issue happens on tldraw.com.

Error: <foreignObject> attribute width: A negative value is not valid. ("-8.5")

For us it specifically happens when you call
const exported = editor.getSvgElement(<shapes that includes arorow>)
and then
exported.svg.cloneNode(true)

Can you have a look at this?

Image

How can we reproduce the bug?

  1. Create arrow
  2. Export it

What browsers are you seeing the problem on?

Chrome

Where did this happen?

The tldraw.com website

Contact Details

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions