From 48860c2cf8489c12ad48cff2a12d33e63eb84651 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Fri, 14 Feb 2020 14:39:55 -0800 Subject: [PATCH] Close Dialog by clicking ouside of it Closes a model/dialog by clicking the greyed out area outside of it. This functionality is the same as if the user clicked the esc key. --- packages/apputils/src/dialog.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/apputils/src/dialog.ts b/packages/apputils/src/dialog.ts index 1b9397ea6af3..06f9828e28a9 100644 --- a/packages/apputils/src/dialog.ts +++ b/packages/apputils/src/dialog.ts @@ -271,6 +271,7 @@ export class Dialog extends Widget { if (!content.contains(event.target as HTMLElement)) { event.stopPropagation(); event.preventDefault(); + this.reject(); return; } for (let buttonNode of this._buttonNodes) {