Skip to content

Commit cbc3d38

Browse files
committed
Fixed scrolling issue when canvas gets focus.
1 parent 47855c6 commit cbc3d38

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

dragonruby-html5-loader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ var Module = {
614614
document.getElementById('game-input').focus();
615615
document.getElementById('game-input').blur();
616616
document.getElementById('game-input').style.display = "none"
617+
window.scrollTo(0, 0);
617618
canvas.focus();
618619
});
619620

game.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
<title>DragonRuby Game Toolkit Tutorial</title>
77
</head>
88
<body id='toplevel'>
9+
<textarea style="display: none;" id="output" rows="1"></textarea>
910
<div class="emscripten_border" id='borderdiv'>
1011
<input id="game-input" autocomplete="off" />
1112
<canvas class="game emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
1213
</div>
1314
<br/>
14-
<textarea style="display: none;" id="output" rows="8"></textarea>
15-
1615
<div class="emscripten" id="status"></div>
1716
<div class="emscripten" id='progressdiv'>
1817
<progress value="0" max="100" id="progress"></progress>

0 commit comments

Comments
 (0)