Set focus properly in confirmation dialogs when in mouse mode

This commit is contained in:
Scott Nonnenberg 2019-12-13 13:19:07 -08:00
parent 526f12bb45
commit 5f58be1a29
4 changed files with 11 additions and 10 deletions

View file

@ -70,7 +70,9 @@
}
},
focusCancel() {
this.$('.cancel').focus();
// We delay this call because we might be called inside click handlers
// which would set focus to themselves afterwards!
setTimeout(() => this.$('.cancel').focus(), 1);
},
});
})();

View file

@ -1850,9 +1850,7 @@
const contact = ConversationController.get(contactId);
const message = this.model.messageCollection.get(messageId);
if (!message) {
throw new Error(
`deleteMessage: Did not find message for id ${messageId}`
);
throw new Error(`forceSend: Did not find message for id ${messageId}`);
}
const dialog = new Whisper.ConfirmationDialogView({

View file

@ -60,6 +60,7 @@
reject,
});
this.$el.append(dialog.el);
dialog.focusCancel();
});
},
},