svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
10.95k stars 1.07k forks source link

[Bug Report] Invalid click event in Firefox #1319

Open ALI1416 opened 6 days ago

ALI1416 commented 6 days ago

Bug report

Invalid click event in Firefox

Chrome is ok

Code

svg.js version : 3.2.4

let svg = SVG().addTo('body').size(300, 300)
let rect = svg.defs().rect(100, 100).attr({fill: '#6cf'}).click(() => {
  console.log('click')
})
svg.use(rect)
Fuzzyma commented 6 days ago

I run this in FF and dont get any error: https://jsfiddle.net/bf7yp4Lc/

I am also not sure what you expect this code to do. The rect lifes in the <devs> and therefore is only rendered through your <use> tag. I dont think events bound to the <use>d element are suppoed to fire. If so, that is rather a bug in FF and not in svg.js