Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#12927 closed bug (notabug)

click events are not captured for svg's in 1.8.3

Reported by: oystein.amundsen@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:

Description

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 7 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.

http://jsfiddle.net/dmethvin/7nsMG/1/

comment:2 Changed 6 years ago by damien@…

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.