Clicking device in rackview opens new tab #6879

Closed
opened 2025-12-29 19:46:17 +01:00 by adam · 1 comment
Owner

Originally created by @sieuwe on GitHub (Aug 26, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.3.1

Python version

3.10

Steps to Reproduce

  1. Go to a rack view
  2. Click on a device in the rack
  3. New tab opens

Expected Behavior

The device used to open in the same window.

Observed Behavior

The device opens in a new tab.

Originally created by @sieuwe on GitHub (Aug 26, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.3.1 ### Python version 3.10 ### Steps to Reproduce 1. Go to a rack view 2. Click on a device in the rack 3. New tab opens ### Expected Behavior The device used to open in the same window. ### Observed Behavior The device opens in a new tab.
adam added the type: bugstatus: accepted labels 2025-12-29 19:46:18 +01:00
adam closed this issue 2025-12-29 19:46:18 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 26, 2022):

This is the default behavior of svgwrite's Hyperlink class (although we do explicitly set target="_blank" in several places). Without this, the linked content will replaced the embedded SVG on the current page. For example, if I remove the link target and then click on a device within an elevation under the rack view, the device page replaces the image:

Screenshot 2022-08-26 at 08-34-47 Rack Comms closet NetBox

I believe the appropriate fix here is to change the link attribute to target="_parent", which forces the link to replace the parent frame or document. (_top is also an option, but could break cases where the SVG image is embedded within a frame.)

This should be applied to cable trace diagrams as well.

@jeremystretch commented on GitHub (Aug 26, 2022): This is the default behavior of svgwrite's `Hyperlink` class (although we do explicitly set `target="_blank"` in several places). Without this, the linked content will replaced the embedded SVG on the current page. For example, if I remove the link target and then click on a device within an elevation under the rack view, the device page replaces the image: ![Screenshot 2022-08-26 at 08-34-47 Rack Comms closet NetBox](https://user-images.githubusercontent.com/13487278/186904571-daa9f704-cd2e-469f-8538-3fee204c5906.png) I believe the appropriate fix here is to change the link attribute to `target="_parent"`, which forces the link to replace the parent frame or document. (`_top` is also an option, but could break cases where the SVG image is embedded within a frame.) This should be applied to cable trace diagrams as well.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6879