mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
63728 - Per-platform behavior of Enter key when a button is focused in a dialog, r=blake, sr=hyatt
This commit is contained in:
parent
6448d3a303
commit
d1f43e0eb6
@ -190,6 +190,15 @@
|
||||
<method name="_hitEnter">
|
||||
<body>
|
||||
<![CDATA[
|
||||
// if a button is focused, dispatch its command instead
|
||||
// of accepting the dialog
|
||||
var focused = document.commandDispatcher.focusedElement;
|
||||
if (focused.localName == "button") {
|
||||
if (focused.hasAttribute("dlgtype"))
|
||||
this._doButtonCommand(focused.getAttribute("dlgtype"));
|
||||
return;
|
||||
}
|
||||
|
||||
// only accept dialog if accept button is the default
|
||||
var btn = this.getButton("accept");
|
||||
if (btn && btn.getAttribute("default") == "true")
|
||||
|
Loading…
Reference in New Issue
Block a user