We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d810342 commit ae6f5e6Copy full SHA for ae6f5e6
src/library_glfw.js
@@ -419,7 +419,10 @@ var LibraryGLFW = {
419
// This logic comes directly from the sdl implementation. We cannot
420
// call preventDefault on all keydown events otherwise onKeyPress will
421
// not get called
422
- if (event.keyCode === 8 /* backspace */ || event.keyCode === 9 /* tab */) {
+ // Prevent default backspace and tab behavior when the target
423
+ // is not an input or textarea. Otherwise, no text in the site can be deleted.
424
+ if (event.target.tagName !== "INPUT" && event.target.tagName !== "TEXTAREA" &&
425
+ (event.keyCode === 8 /* backspace */ || event.keyCode === 9 /* tab */)) {
426
event.preventDefault();
427
}
428
},
0 commit comments