--- a/svghmi/widget_dropdown.ysl2 Tue Apr 14 12:07:08 2020 +0200
+++ b/svghmi/widget_dropdown.ysl2 Tue Apr 14 17:13:12 2020 +0200
@@ -20,6 +20,7 @@
+ this.bound_inhibit_click_elsewhere = this.inhibit_click_elsewhere.bind(this); on_selection_click: function(selection) {
console.log("selected "+selection);
@@ -72,10 +73,17 @@
+ inhibit_click_elsewhere: function(e) { + console.log("inhibit", e); + console.log(e.target.parentNode, this.text_elt); + if(e.target.parentNode !== this.text_elt) this.element.appendChild(this.button_elt);
+ document.removeEventListener("click", this.bound_inhibit_click_elsewhere, true); set_complete_text: function(){
@@ -138,7 +146,8 @@
this.adjust_box_to_text();
this.element.removeChild(this.button_elt);
- /* TODO disable interaction with background */
+ // disable interaction with background + document.addEventListener("click", this.bound_inhibit_click_elsewhere, true);