From 0783eb98813b6ccb17aeda5dede696e3367ff020 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Sun, 19 Aug 2018 14:14:05 -0700 Subject: [PATCH] fix: #14160 (#14205) --- atom/browser/ui/message_box_mac.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/atom/browser/ui/message_box_mac.mm b/atom/browser/ui/message_box_mac.mm index a29ebff7bead..ee2f59dc8c84 100644 --- a/atom/browser/ui/message_box_mac.mm +++ b/atom/browser/ui/message_box_mac.mm @@ -97,11 +97,6 @@ NSAlert* CreateNSAlert(NativeWindow* parent_window, NSArray* ns_buttons = [alert buttons]; int button_count = static_cast([ns_buttons count]); - // Bind cancel id button to escape key if there is more than one button - if (button_count > 1 && cancel_id >= 0 && cancel_id < button_count) { - [[ns_buttons objectAtIndex:cancel_id] setKeyEquivalent:@"\e"]; - } - if (default_id >= 0 && default_id < button_count) { // Focus the button at default_id if the user opted to do so. // The first button added gets set as the default selected. @@ -110,6 +105,11 @@ NSAlert* CreateNSAlert(NativeWindow* parent_window, [[ns_buttons objectAtIndex:default_id] setKeyEquivalent:@"\r"]; } + // Bind cancel id button to escape key if there is more than one button + if (button_count > 1 && cancel_id >= 0 && cancel_id < button_count) { + [[ns_buttons objectAtIndex:cancel_id] setKeyEquivalent:@"\e"]; + } + if (!checkbox_label.empty()) { alert.showsSuppressionButton = YES; alert.suppressionButton.title = base::SysUTF8ToNSString(checkbox_label);