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:
parent
e909b0466c
commit
369e54c1ef
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue