Click event on SVG <use> element firing on <defs> -> <use>

Fixed Issue #15727705


Porter M.
Jan 31, 2018
This issue is public.
Found in
  • Microsoft Edge
Found in build #
Fixed in build #
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Steps to reproduce

  1. Load the attached “eventIssue.html” open and open developer tools.
  2. Click on SVG element.

As you can see, event firing on <g id="italian-flag"> inside <defs>. Not inside the <g id="svg-group">.

Issue reproduced on:

  • Edge/16.16299 works fine on:

  • Chrome
  • Opera
  • IE
  • Edge 15
  • Firefox
  • Safari


Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Steven K.”

    Changed Assigned To to “Travis L.”

    Changed Assigned To to “Bogdan B.”

  • Thanks for the report. IE and Edge used to have problems with hit-testing for USE elements pointing to external svg files, and I guess this new issue is the result of the changes that have been done to fix that. 

    As you noted, we still fire the click event on the <use> element, but we also fire it on the elements that have been clicked in the other document if they are in a scriptable context. As it turns out, this changes the eventTarget in case these elements are actually in the same document (USE elements pointing to internal svg nodes). 

    You can use event.currentTarget if you need the element on which the event is currently being fired. It is not clear to me our behavior here is a bug, but we will probably try to match other browsers if we see websites being affected.

  • @Francois R. I cant use "event.currentTarget", because it returns me "undefiend". How i can get parentNode?

  • Sorry, I hadn’t seen this message. I added a modified of your test case that shows how to obtain the <use> element with currentTarget.

  • Microsoft Edge Team

    Changed Assigned To from “Bogdan B.” to “Saqib A.”

    Changed Status to “Confirmed”

  • The issue blocks our SVG app to run on Edge, any estimated fix date?

  • Microsoft Edge Team

    Changed Status from “Confirmed” to “Fixed”

  • The next version of Edge will have a fix for this issue. The next version of Edge will be released together with the Fall 2018 update of Windows.

You need to sign in to your Microsoft account to add a comment.

Sign in