Skip to content

Commit 7cb0f65

Browse files
HTMLMesh: Add support for input of type text and number, calling input.focus() to bring the system keyboard in VR (#31160)
1 parent a5a4983 commit 7cb0f65

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

examples/jsm/interactive/HTMLMesh.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,12 @@ function htmlevent( element, event, x, y ) {
578578

579579
}
580580

581+
if ( element instanceof HTMLInputElement && ( element.type === 'text' || element.type === 'number' ) && ( event === 'mousedown' || event === 'click' ) ) {
582+
583+
element.focus();
584+
585+
}
586+
581587
}
582588

583589
for ( let i = 0; i < element.childNodes.length; i ++ ) {

0 commit comments

Comments
 (0)