homegames-client 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD_PARTY_NOTICES.txt +1 -1
- package/dist/homegames-client.js +2 -2
- package/package.json +1 -1
- package/src/input.js +7 -0
package/package.json
CHANGED
package/src/input.js
CHANGED
|
@@ -183,6 +183,13 @@ class InputHandler {
|
|
|
183
183
|
// that would normally focus an embedded game. Treat this direct
|
|
184
184
|
// gesture as input focus so the first tap can reach the game too.
|
|
185
185
|
// Page-control touches return above; blur still releases input.
|
|
186
|
+
// preventDefault also suppresses native focus transfer. Move DOM
|
|
187
|
+
// focus into the canvas so a later keyboard press cannot activate
|
|
188
|
+
// the embedding toolbar's previously focused button.
|
|
189
|
+
if (typeof this.canvas.focus === 'function') {
|
|
190
|
+
if (this.canvas.tabIndex < 0) this.canvas.tabIndex = -1;
|
|
191
|
+
this.canvas.focus({ preventScroll: true });
|
|
192
|
+
}
|
|
186
193
|
this._focused = true;
|
|
187
194
|
this._touchActive = true;
|
|
188
195
|
clearTimeout(this.clickStopper); this.clickStopper = null;
|