Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Fix a case when another button than primary is focused and user hits …
Browse files Browse the repository at this point in the history
…an enter key.
  • Loading branch information
zaggino committed Jun 4, 2014
1 parent d0f185b commit 046aa94
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/widgets/Dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ define(function (require, exports, module) {
// Enter key in single-line text input always dismisses; in text area, only Ctrl+Enter dismisses
// Click primary
stopEvent();
$primaryBtn.click();
if (e.target.tagName === "BUTTON") {
this.find(e.target).click();
} else {
$primaryBtn.click();
}
} else if (e.which === KeyEvent.DOM_VK_SPACE) {
if ($focusedElement.length) {
// Space bar on focused button or link
Expand Down

0 comments on commit 046aa94

Please sign in to comment.