-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Description
Description of the problem
OrbitControls registers a listener for keydown events on a window and processes the events regardless of which input element has focus. When a user uses keyboard to move cursor in an input field, the events for the left and right arrow keys of keyboard are handled by OrbitControls and do not move the cursor. Better behaviour would be to ignore the event if some other input element has the focus.
Steps to reproduce, using current dev branch and examples:
- Open documentation (
docs\index.html) and navigate toTorusGeometrydocument. - In the iframe that displays an example of a torus, click on "THREE.TorusGeometry" button to open a properties editor for the object.
- Click on one of input boxes in the properties editor, e,g, on the value "10" for radius.
- Try to use your keyboard to move cursor position to the left and to the right in the input field.
Expected behaviour: the cursor moves, as you press left or right arrows on your keyboard.
Actual behaviour: the image of the torus moves.
The behaviour of r101 is to suppress all keydown events, regardless of key code (known as #15810, already fixed in dev). The behaviour of r100 was to move both the cursor and the object.
This issue could be fixed by either a) registering the keydown listener on the domElement instead of a window, b) filtering the event according to the actual value of document.activeElement. The "b)" way seems to provide better compatibility with older versions of three.js.
Three.js version
- Dev
- r101
Browser
- Chrome
- Firefox
OS
- Windows