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
Contributor
Lawrence_Liu
Posts: 29
Registered: ‎09-05-2012
My Device: BlackBerry Q10 Z10
My Carrier: China Mobile

onclick event can not be triggered if float:left or float:right used in div

[ Edited ]

Dear All,

 

I found an issue that 

 

onclick event can not be triggered if float:left or float:right used in div, in the simulator, while at the same time the same code works fine in ripple.

 

I am not sure whether it works fine in the actual machine,

 

Here are the demo code

 

<div id="d1" style="float:left;width:35%" onclick="document.getElementById('d1').style.width='22%';"></div>

<div id="d2" style="float:left;width:65%" onclick="document.getElementById('d2').style.width='78%';"></div>

 

the onclick was triggered and works fine, in ripple, but does not work on simulator, 

 

Here are the version information:

 

WebWorks SDK: Gold

Simulator: 10.0.09.1101

Ripple: V0.9.10 Beta

 

Hope someone could help on this issue.

 

Appreciate for any valuable information.

 

 

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 619
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: onclick event can not be triggered if float:left or float:right used in div

Have you downloaded the latest simulator?  Looks like you're running the old version.

 

Simulator: 10.0.09.1101

 

New one should be: 10.0.09.1673

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Contributor
Lawrence_Liu
Posts: 29
Registered: ‎09-05-2012
My Device: BlackBerry Q10 Z10
My Carrier: China Mobile

Re: onclick event can not be triggered if float:left or float:right used in div

Dear Chadtatro,

 

Thanks for your reply, I have updated the simulator to the latest version , but this issue remains the same,

 

I got the information that float attribute of css is supported, from official webworks document.

 

But seems even the layout is working fine, the javascript event was not triggered.

 

I have update my code to use absolute position to avoid this issue and the work around works fine, except that I have to write slightly  a little more javascript code.

 

I think that might be an issue in the simulator, not sure whether it works on the develop alpha and beta machine, could you please help to write a test case and test whether it works or not?

 

Would like to appreicate for your great help on this.

 

Best regards.

Lawrence.

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 619
Registered: ‎10-01-2009
My Device: Z10
My Carrier: Bell

Re: onclick event can not be triggered if float:left or float:right used in div

It's definitely working on the dev alpha.

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.