RE: No "pointer-events" property to make svg tag trigger events.

You can put events on the <svg/> root element, but they will
    only fire if a geometry is present at the pointers location. You
    need to create an "invisible" rectangle in the file, but you don't
    have to put the event handlers on the rectangle - you can attach
    them to the <svg /> element.



    Thanks for confirming that.  The issue is that sometimes it would be nice to have the svg trigger events directly without requiring a rectangle.  I ran into a particular situation where this was desirable.  One issue is that I must constantly resize and move the rectangle around as the svg canvas area changes size and the viewBox moves around.  In the end, the code must move and resize both the svg and a rect (in sync) to make it work right; this is not really the most desirable method.  However, in the end, I can always find a workaround to these issues.

However, the biggest concern is regarding this:
If SVG has no way to force an svg tag to receive events, then I guess that could be a problem depending on the way svg-in-html finally gets integrated.
I  guess I should contact Doug Schepers about this.

    On 12/16/10 1:07 AM, Kevin Ar18 wrote:
      As far as I know, SVG does not have a way to force an svg
      container to trigger pointer-events.


      I thought the "boundingBox" property would do this, but it seems
      that is controlled by graphical elements within the svg and not
      the actual dimensions of the svg tag itself.  Is this correct?


      If so, are there any plans to add a way to allow the svg tag to
      trigger events?



      There are two specific instances where this is sort of a problem:

      1. Within an svg document, if I want to specify a "canvas area"
      that I can interact with.  I realize I can use a rect or some
      other graphical object to do this; however, sometimes this adds
      much more complexity to the javascript "app" as I have to work
      around the DOM in certain ways.

      2. This could affect the svg-in-html/css question.


Received on Thursday, 16 December 2010 23:48:06 UTC