Skip to main content

Bug Tracker

Side navigation

#12927 closed bug (notabug)

Opened November 20, 2012 12:59PM UTC

Closed November 21, 2012 05:59PM UTC

Last modified February 13, 2013 01:02AM UTC

click events are not captured for svg's in 1.8.3

Reported by: oystein.amundsen@gmail.com 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/

Attachments (0)
Change History (2)

Changed November 21, 2012 05:59PM UTC by dmethvin comment:1

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/

Changed February 13, 2013 01:02AM UTC by damien@rebase.com.au comment:2

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'