question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Links created in svgs are not working in latest Chrome, Firefox and Safari

See original GitHub issue

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Describe the bug When exporting an image that contains a link, the link does not work in the latest Chrome, Firefox, Safari. Draw.io uses xlink:href to create links in svg images. This is a deprecated feature of svg v2 and apparently modern browsers already removed support for this.

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘app.diagrams.net’
  2. Create a new diagram
  3. Add a link to a diagram
  4. Export diagram to svg
  5. Open svg image in latest Chrome/Safari/Firefox
  6. Try to click on the link element

Expected behavior The element with the link is clickable.

Screenshots N/a

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io version 13.1.3]

Desktop (please complete the following information):

  • OS: Mac OS 10.15.4
  • Browser Chrome (81.0.4044.138), Safari (13.1 (15609.1.20.111.8)), Firefox (76.0.1)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
kevinlrakcommented, Dec 16, 2020

@Starlight220 To fix that, ensure the <a> element in your SVG has the target attribute as described here: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/target

In draw.io, you can experiment with values of that attribute if you go to File>Export as>SVG, then click the Links drop-down and select something other than automatic.

0reactions
Starlight220commented, Nov 23, 2020

This embeds the diagram, but when links are pressed the linked page is rendered only in the space that the diagram occupied. Ideas?

<object type="image/svg+xml" data="img/diagram.drawio.svg">
    
</object>
Read more comments on GitHub >

github_iconTop Results From Across the Web

The SVG logo does not display my site on firefox
The SVG logo on my site is not showing up on firefox, it works fine on Chrome, Egde, safari, .. How to fix...
Read more >
Svg image element not displaying in Safari - Stack Overflow
In the <image> tag inside the svg element, href works fine in Chrome. To work in older versions of Safari, you need xlink:href...
Read more >
Here's How I Solved a Weird Bug Using Tried and True ...
At first, this looks like a CSS issue. Some styles might be applied on a hover event that breaks the layout or the...
Read more >
Intructions for viewing SVG images
Most major browsers now have native support for SVGs. We have had good results with recent versions of Firefox, Chrome and Opera. If...
Read more >
Browser Support for Viewing SVG Files - SAS Help Center
3 When an animated SVG file is opened in Safari, the Refresh button does not work. You need to refresh the browser. Using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found