зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1122463 - Don't blur the input when submit is cancelled. r=yxl
--HG-- extra : rebase_source : 02b5f6bdd130c58355371cce630f58e00647b4d7
This commit is contained in:
Родитель
120dc65a46
Коммит
6ad39882f0
|
@ -193,7 +193,9 @@ let FormAssistant = {
|
|||
addEventListener("focus", this, true, false);
|
||||
addEventListener("blur", this, true, false);
|
||||
addEventListener("resize", this, true, false);
|
||||
addEventListener("submit", this, true, false);
|
||||
// We should not blur the fucus if the submit event is cancelled,
|
||||
// therefore we are binding our event listener in the bubbling phase here.
|
||||
addEventListener("submit", this, false, false);
|
||||
addEventListener("pagehide", this, true, false);
|
||||
addEventListener("beforeunload", this, true, false);
|
||||
addEventListener("input", this, true, false);
|
||||
|
@ -399,7 +401,7 @@ let FormAssistant = {
|
|||
}
|
||||
// fall through
|
||||
case "submit":
|
||||
if (this.focusedElement) {
|
||||
if (this.focusedElement && !evt.defaultPrevented) {
|
||||
this.focusedElement.blur();
|
||||
}
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче