xml3d / xml3d.js

The WebGL/JS implementation of XML3D
Other
75 stars 25 forks source link

tools/camera.js messes up slider behaviour for input type="range" #139

Closed fnunnari closed 8 years ago

fnunnari commented 9 years ago

Hi there,

When using the camera.js, to navigate the scene using the mouse, an input selector of type "range" doesn't work properly anymore. Once clicked, the slider remains "attached" to the mouse pointer and doesn't loose the focus. Not even when clicking outside or pressing tab.

To me, looks like the xml3d canvas is "eating up" the mouse-released event that would unlock the slider.

Happens in Chrome Version 44.0.2403.130 (64-bit), Firefox 39.0, and Opera 31.0.1889.99. Mac OS X 10.9.5 64-bit.

The following code reproduce the problem. Comment out the inclusion of camera.js and the slider will behave correctly.

<!doctype html> <html> <head> <title>XML3D Boilerplate Code</title> <!-- Include the xml3d.js library first --> <script type="text/javascript" src="http://www.xml3d.org/xml3d/script/xml3d.js&quot; > </script> <!-- COMMENT OUT THE FOLLOWING LINE (CAMERA.JS) AND THE SLIDER WILL BEHAVE CORRECTLY --> <script type="text/javascript" src="http://www.xml3d.org/xml3d/script/tools/camera.js&quot; > </script> <!-- Other <script> tags --> <script type="text/javascript"> function setAnimationKeyframe(kf) { console.log("Animation KF: "+kf) } </script> </head> <body> <!-- You can place an xml3d element anywhere inside <body>. Currently we only support inline style properties to style the xml3d element --> <xml3d style="width: 600px; height: 400px;" activeView="#currentView" > <!-- The view element determines the camera position of the 3D scene. When using multiple <view> element, you can select one view by document id via the activeView attribute of <xml3d> --> <view id="currentView" position="0 0 50"></view> </xml3d> Keyframe number: <input type="range" min="1" value="1" max="25" step="1" oninput="setAnimationKeyframe(event.target.value);"> </body> </html>

csvurt commented 9 years ago

The standard camera is getting a major overhaul in 5.0, I've pulled the relevant fixes over to our 4.9.4 hotfix branch. The hotfix will probably go out next week until then you could checkout camera.js from hotfix-4.9.4 it seems to work fine with your example scene now.

Thanks for the report!