Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#12927 closed bug (notabug)

click events are not captured for svg's in 1.8.3

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:


The following fiddle will prove this: http://jsfiddle.net/OysteinAmundsen/7nsMG/

This is using jQuery 1.8.3.

The next fiddle is using jQuery 1.8.1, which does in fact work as expected: http://jsfiddle.net/OysteinAmundsen/L7pCZ/1/

Change History (2)

comment:1 Changed 10 years ago by dmethvin

Resolution: notabug
Status: newclosed

The .class syntax is a DOM thing not an SVG thing. If you are using SVG (which is XML) then you must use [class=node] instead.


comment:2 Changed 10 years ago by [email protected]

Probably best with [class~=node]

This did, however, work in previous versions.

A lot of javascript uses classes on SVG elements, and jQuery selectors on those makes it pretty powerful. Checking the class attribute seems more like a work-around than 'the way to do it'

Note: See TracTickets for help on using tickets.