Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
Posts: 2
Registered: ‎03-17-2011
My Device: Developer
My Carrier: NA

touchevent listeners on SVG DOM element not working ?

Hi,

 

[Using the 9800 simulator, OS v.6 ]

 

While working with SVG and touch interaction in my applicaiton, it seems that touchevent are not received by SVG DOM element. Indeed, with the following svg :

 

 

<body>
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" >

<rect id="rect1" ontouchstart="alert('touchstart');" onmousedown="alert('mousedown')" x="10" y="45" width="300" height="300" fill="#ff0000"/> </svg></body></html>

 

When I test this page in the 9800 simulator, the behavior is:

1: pressing left mouse button on the rect  -> onmousedown is received

2: pressing right mouse button on the rect -> onmousedown is received, while I was expecting a touchstart.

 

Note that if I add  a <span> element that listens to touchstart event, it gets correctly notified (it also crashes the JVM, but that's another story Smiley Happy ). So it really seems to be SVG-DOM specific.

 

So my question: are touch events supported on SVG DOM element ? 

Thx

Patrick

Developer
Posts: 37
Registered: ‎12-24-2010
My Device: Tour
My Carrier: Verizon

Re: touchevent listeners on SVG DOM element not working ?

This is a little off topic, but does the onmousedown event work for you on a simulator with a 5.0 OS? I am also trying to work on an app with SVG, but cannot get the events to fire with 5.0.

New Contributor
Posts: 2
Registered: ‎03-17-2011
My Device: Developer
My Carrier: NA

Re: touchevent listeners on SVG DOM element not working ?

Up...

 

So, are there any support for touching event on the SVG nodes in BB os 6.0 ?

 

Patrick

 

PS: @Silaryn: what simulator are you using ? I tried the 5.0.0.621 (model 9650) and svg is not displayed at all. sorry...