Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pointer events setting missing in a generated SVG #3806

Closed
iherman opened this issue Aug 23, 2023 · 3 comments
Closed

pointer events setting missing in a generated SVG #3806

iherman opened this issue Aug 23, 2023 · 3 comments

Comments

@iherman
Copy link

iherman commented Aug 23, 2023

Preflight Checklist

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

Describe the bug

I create a shape (rectangle, ellipse, closed path) with a transparent interior and a visible boundary. The shape has a text label and an associated hyperlink. I then export this to SVG. The rough structure of the relevant SVG is:

 <a xlink:href="">
    <rectfill="none" stroke="black" stroke-width="2"/>
    <switch>
        <foreignObject>
              [label in HTML]
       </foreignObject>
      <text …>label</text>
   </switch>
</a>

When using the SVG, only the boundary of the shape is sensitive as a hyperlink active area, the interior isn't. What is missing, to make the full shape usable as an anchor, is a pointer-event="all" attribute in the <rect> element.

The strange thing is that sometimes draw.io does add this attribute, yielding the expected behavior. I have found no rational explanation when it happens and when it does not, nor have I found a user interface setting to control the behavior.

Expected behavior

Ideally, the behavior should be settable by the user (if there is such a setting, then my apologies for the noise, but I did spend quite some time to locate it...). In the absence, in my view, the attribute should be set systematically; there is no reason why a non-filled shape with an associated link should restrict its active area to the boundary.

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

  • draw.io version 21.6.8 standalone application

Desktop (please complete the following information):

  • OS: MacOS Ventura 13.5
  • Browser n/a (used it as a separate application, although the behavior was similar when used draw.io from within google drive
  • Version n/a

Additional context
Setting the shape with a specific background, ie, fill it, would of course solve the issue, but it creates problem with a switch on/off of night mode with the generated SVG.

@alderg
Copy link
Contributor

alderg commented Aug 23, 2023

Can you please attach the diagram file you used for testing?

@iherman
Copy link
Author

iherman commented Aug 23, 2023

Thanks for nudging me, @alderg, for a test case, because while I was doing it, it revealed something that might help to locate a bug.

I have put a test draw.io on Google Drive (I hope you can access it without further ado). I have also put the generated SVG. The SVG file shows that the ellipse has the required attribute, whereas the two rectangles do not.

The interesting point is that, in the original diagram, the two rectangles (labeled as secretKeyMultibase and publicKeyMultibase) are grouped. If I ungroup them, then things are all right. This may help to locate the bug.

The further interesting experience is that, somehow, this problem "contaminates" a whole diagram. I indeed started with a much larger diagram that I was working on, and which went wrong; if I removed a larger group that included those rectangles, the rest generated proper SVG-s, and otherwise all shapes went wrong... (even shapes that do not have a direct "connection", in terms of grouping, with the suspects...)

I hope this helps in locating the bug.

Thx.

@davidjgraph
Copy link
Collaborator

Added in 21.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants