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);