0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-02-07 19:06:26 -05:00

Added tabIndex to canvas defaults

This will allow for in-focus keyboard input without needing to wrap the renderer or use and DOM queries to append it. This separates the canvas as a focusable element, meaning that a single page could have keyboard-controlled canvas rendering and textareas or other keyboard inputs without conflict.
This commit is contained in:
Secundino Martinez 2021-06-20 18:02:53 -07:00 committed by GitHub
parent e909b0466c
commit 369e54c1ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1472,6 +1472,7 @@ var Mouse = require('../core/Mouse');
canvas.height = height;
canvas.oncontextmenu = function() { return false; };
canvas.onselectstart = function() { return false; };
canvas.tabIndex = 1;
return canvas;
};