From 7489da5bd64b346eab873cf7771da6fb32399b05 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 28 Oct 2024 17:05:34 +0800 Subject: [PATCH] bugfix --- bricks/popup.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bricks/popup.js b/bricks/popup.js index 60bdcf9..d5404e7 100644 --- a/bricks/popup.js +++ b/bricks/popup.js @@ -16,6 +16,14 @@ bricks.Popup = class extends bricks.VBox { this.set_css('popup'); const zindex = bricks.app.new_zindex(); this.set_style('zIndex', zindex); + if (this.auto_dismiss){ + bricks.Body.bind('click', this.click_outside.bind(this)); + } + } + click_outside(event){ + if (event.target != this.dom_element){ + this.dismiss(); + } } add_widget(w, index){ super.add_widget(w, index);