@@ -747,10 +747,7 @@ function createSqueakDisplay(canvas, options) {
747
747
input . setAttribute ( "autocapitalize" , "off" ) ;
748
748
input . setAttribute ( "spellcheck" , "false" ) ;
749
749
input . style . position = "absolute" ;
750
- input . style . width = "0" ;
751
- input . style . height = "0" ;
752
- input . style . opacity = "0" ;
753
- input . style . pointerEvents = "none" ;
750
+ input . style . left = "-1000px" ;
754
751
canvas . parentElement . appendChild ( input ) ;
755
752
// touch-keyboard buttons
756
753
if ( 'ontouchstart' in document ) {
@@ -761,7 +758,7 @@ function createSqueakDisplay(canvas, options) {
761
758
canvas . parentElement . appendChild ( keyboardButton ) ;
762
759
keyboardButton . onmousedown = function ( evt ) {
763
760
// show on-screen keyboard
764
- input . focus ( ) ;
761
+ input . focus ( { preventScroll : true } ) ;
765
762
evt . preventDefault ( ) ;
766
763
}
767
764
keyboardButton . ontouchstart = keyboardButton . onmousedown ;
@@ -795,8 +792,8 @@ function createSqueakDisplay(canvas, options) {
795
792
cmdButton . ontouchcancel = cmdButton . ontouchend ;
796
793
} else {
797
794
// keep focus on input field
798
- input . onblur = function ( ) { input . focus ( ) ; } ;
799
- input . focus ( ) ;
795
+ input . onblur = function ( ) { input . focus ( { preventScroll : true } ) ; } ;
796
+ input . focus ( { preventScroll : true } ) ;
800
797
}
801
798
display . isMac = navigator . userAgent . includes ( "Mac" ) ;
802
799
// emulate keypress events
0 commit comments