Skip to content

Commit 2b3c41f

Browse files
keyboard focus: blur/focus toggle
1 parent b3fdd67 commit 2b3c41f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

com/isoterminal.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,14 @@ if( typeof AFRAME != 'undefined '){
390390

391391
const focus = (e) => {
392392

393+
if( event.target == document.activeElement ){
394+
// if we're already focused, the keyboard is already triggerend
395+
// therefore we blur() the element for correctness
396+
// which allows the WebXR keyboard dissappear if implemented at all
397+
// [Meta Quest 2 does not do this]
398+
event.target.blur()
399+
}
400+
393401
// calculate distance between thumb and indexfinger to detect pinch
394402
// which should prevent focus-event (annoying to have keyboard popping up during pinch)
395403
if( e.detail?.withEl?.components['hand-tracking-controls'] ){

com/isoterminal/term.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,6 @@ Term.prototype.blurHandler = function (ev)
12591259

12601260
Term.prototype.pasteHandler = function (ev)
12611261
{
1262-
debugger
12631262
var c, str;
12641263
if (!this.textarea_has_focus) {
12651264
c = ev.clipboardData;

0 commit comments

Comments
 (0)