Skip to content
Permalink
Browse files

fix: set cancelId to 1 when defaultId == 0 and no 'cancel' button (#1…

  • Loading branch information...
trop authored and codebytere committed Feb 27, 2019
1 parent 6d313b4 commit 4e0d4c478576051403abb91b0dd212b720314354
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/browser/api/dialog.js
@@ -263,7 +263,8 @@ module.exports = {

// Choose a default button to get selected when dialog is cancelled.
if (cancelId == null) {
cancelId = 0
// If the defaultId is set to 0, ensure the cancel button is a different index (1)
cancelId = (defaultId === 0 && buttons.length > 1) ? 1 : 0
for (let i = 0; i < buttons.length; i++) {
const text = buttons[i].toLowerCase()
if (text === 'cancel' || text === 'no') {

0 comments on commit 4e0d4c4

Please sign in to comment.
You can’t perform that action at this time.