Right click on svg to open new tab with element


Yukulele

With firefox, when I middle-click (or ctrl+click) on an useelement , it will open the url xlink:hrefin a new tab (like href)

Bug or feature?

<svg viewBox="0 0 400 80">
    <circle id="circle" cx="40" cy="40" r="30" fill="#29e"></circle>
    <use xlink:href="#circle" transform="translate(70, 0)" style="stroke: red;"></use>
</svg>
<p>ctrl+click on right circle</p>

pp19dd

This is an unresolved bug and they are not sure how to handle it. Triggers are xlink:hrefhandled internally, just like A.href (middle-click or Ctrl+click to open to open a new tab.) A workaround is to xlink:hrefhide the element under an invisible rectangle:

    <svg viewBox="0 0 400 80">
        <circle id="circle" cx="40" cy="40" r="30" fill="#29e" />
        <use xlink:href="#circle" transform="translate(70, 0)" style="stroke: red;" />
        <rect style="opacity:0" x="80" y="10" width="60" height="60" />
    </svg>
    <p>ctrl+click on right circle - nothing happens</p>

If you have any events that need to be fired, you have to bind them to invisible rectangles.

Related


Right click on svg to open new tab with element

Yukulele With firefox, when I middle-click (or ctrl+click) on an useelement , it opens the url xlink:hrefin a new tab (like href) Bug or feature? <svg viewBox="0 0 400 80"> <circle id="circle" cx="40" cy="40" r="30" fill="#29e"></circle> <use xlink:hre

Right click on svg to open new tab with element

Yukulele With firefox, when I middle-click (or ctrl+click) on an useelement , it opens the url xlink:hrefin a new tab (like href) Bug or feature? <svg viewBox="0 0 400 80"> <circle id="circle" cx="40" cy="40" r="30" fill="#29e"></circle> <use xlink:hre

Right click to enable "open in new tab/window"

Michael Chodakis My link is a javascript function that shows the loader and then navigates to the target link: <script> function go(url) { document.body.innerHTML = "some loader html"; window.location = url; } </script> <a href="javascript:go('test.php');"

Right click and save link to open in new tab

Dishu I added a custom right click menu using jquery in my project, now what I want to achieve is: -> If anyone right clicks on the link, the option will say "Open link in new tab", when that option is selected, it will open in a new tab with that link. -> Oth

Right click to enable "open in new tab/window"

Michael Chodakis My link is a javascript function that shows the loader and then navigates to the target link: <script> function go(url) { document.body.innerHTML = "some loader html"; window.location = url; } </script> <a href="javascript:go('test.php');"

Customize right click anchor tag to open link in new tab

usman610 I have the following code to open a specific right click menu for <a>an element . On any link I right click and click to open in a new tab, it only opens the first link. Counters in java-script are related to my inability to do so. hrefI want to open

CakePHP open to new tab on click

mark I have a function in my app where user can upload files to web server. These uploaded files will then appear in another page where another type of user can click the link. After clicking the link, a new tab will open and the file will be displayed. But I

Click the button to open a new tab

Nathan Wilson I want to create a link with a button that opens in a new tab. The code I'm currently using is currently opening a blank tab and I'm not sure why. <div class="text text-left"> <h2>WORK</h2> <h1>Title</h1> <p>Lorem ipsum dolor sit am

Click the button to open a new tab

Nathan Wilson I want to create a link with a button that opens in a new tab. The code I'm currently using is currently opening a blank tab and I'm not sure why. <div class="text text-left"> <h2>WORK</h2> <h1>Title</h1> <p>Lorem ipsum dolor sit am

CakePHP open to new tab on click

mark I have a function in my app where user can upload files to web server. These uploaded files will then appear in another page where another type of user can click the link. After clicking the link, a new tab will open and the file will be displayed. But I

D3js: How to open new tab after double click on element?

Hugo On my dataviz, the input topojson and svg polygons both contain attributes name:"..."and data-name="...". In my D3js code I currently have: function click(a){console.log(a.properties.name);} The value of name is printed out successfully. Besides that, ho

D3js: How to open new tab after double click on element?

Hugo On my dataviz, the input topojson and svg polygons both contain attributes name:"..."and data-name="...". In my D3js code I currently have: function click(a){console.log(a.properties.name);} The value of name is printed out successfully. Besides that, ho

D3js: How to open new tab after double click on element?

Hugo On my dataviz, the input topojson and svg polygons both contain attributes name:"..."and data-name="...". In my D3js code I currently have: function click(a){console.log(a.properties.name);} The value of name is printed out successfully. Besides that, ho

Open a new tab after button click in AngularJS

Neptune: <button type="button" class="btn btn-primary" ng-click="openTab()">new tab</button> openTab = function () { $http.post('www.google.com'); } What I want is to post a requirement and then open the response html in a new tab when the "openTab" button

Selenium - click on the link to open a new tab

tree 55 I've seen a lot of threads on how to open a link in a new tab, but what if you have a link that creates a new tab and you need to verify the title? All I need to do is click the link -> confirm the new tab has the correct title -> close the tab and con