A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix: prevent dialogs from closing when clicking overlay background
esengine7ef6598f57c4
diff --git a/editor/src/launcher/NewProjectDialog.ts b/editor/src/launcher/NewProjectDialog.tsindex 7281434a5..cae8f768f 100644--- a/editor/src/launcher/NewProjectDialog.ts+++ b/editor/src/launcher/NewProjectDialog.ts@@ -119,13 +119,6 @@ export class NewProjectDialog {});});- // Overlay click to close- this.overlay_.addEventListener('click', (e) => {- if (e.target === this.overlay_) {- this.options_.onClose();- }- });-// Escape key to closeconst keyHandler = (e: KeyboardEvent) => {if (e.key === 'Escape') {diff --git a/editor/src/panels/AddComponentPopup.ts b/editor/src/panels/AddComponentPopup.tsindex 45a82023d..07b140cde 100644--- a/editor/src/panels/AddComponentPopup.ts+++ b/editor/src/panels/AddComponentPopup.ts@@ -212,12 +212,6 @@ export function showAddComponentPopup(overlay.remove();};- overlay.addEventListener('click', (e) => {- if (e.target === overlay) {- close();- }- });-const popup = new AddComponentPopup(container, {existingComponents,onSelect,diff --git a/editor/src/ui/dialog/Dialog.ts b/editor/src/ui/dialog/Dialog.tsindex ece2122f0..93a889ca9 100644--- a/editor/src/ui/dialog/Dialog.ts+++ b/editor/src/ui/dialog/Dialog.ts@@ -16,7 +16,7 @@ export class Dialog {constructor(options: DialogOptions) {this.options_ = {width: 480,- closeOnOverlay: true,+ closeOnOverlay: false,closeOnEscape: true,showCloseButton: true,...options,