mirror of https://github.com/docker/docs.git
Fixed cannot backspace when form is focused.
This commit is contained in:
parent
13b829ba5f
commit
f401c97001
11
src/Main.js
11
src/Main.js
|
@ -51,7 +51,18 @@ Menu.setApplicationMenu(menu);
|
|||
|
||||
document.onkeydown = function (e) {
|
||||
e = e || window.event;
|
||||
var doPrevent;
|
||||
if (e.keyCode === 8) {
|
||||
var d = e.srcElement || e.target;
|
||||
if (d.tagName.toUpperCase() === 'INPUT' || d.tagName.toUpperCase() === 'TEXTAREA') {
|
||||
doPrevent = d.readOnly || d.disabled;
|
||||
} else {
|
||||
doPrevent = true;
|
||||
}
|
||||
} else {
|
||||
doPrevent = false;
|
||||
}
|
||||
if (doPrevent) {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue