diff --git a/README.md b/README.md
index a70ae59..cef4d90 100644
--- a/README.md
+++ b/README.md
@@ -240,6 +240,7 @@ dropdown options have.
* value - String
* avoidHeaderOverlappingDropdown - Boolean , default: false . This was added for a case in pmp, where when the dropdown
oppened upwards, the search input was covered by the header of the app
+* disableOnFocusHandling - Boolean, default: false. Set to true to disable onFocus handling on the dropdown (more specifically the contained paper-input-container). We set this to true when the dropdown is in a modal, to avoid a bug that consists of the dropdown overlay closing and opening again and remaining opened , when clicking outside the dropdown or after selecting an item
## Usage
Examples:
diff --git a/behaviors/common-behavior.html b/behaviors/common-behavior.html
index eaebbeb..0212fa9 100644
--- a/behaviors/common-behavior.html
+++ b/behaviors/common-behavior.html
@@ -115,6 +115,11 @@
_resizedManually: {
type: Boolean,
value: false
+ },
+ disableOnFocusHandling: {
+ type: Boolean,
+ value: false,
+ reflectToAttribute: true
}
},
listeners: {
@@ -271,7 +276,13 @@
var ddContent = this._getDropdownContent();
ddContent.style.height = 'auto';
this.notifyDropdownResize();
- }
+ },
+ _onFocusInputContainer: function() {
+ if (this.disableOnFocusHandling) {
+ return;
+ }
+ this._openMenu();
+ },
};
diff --git a/bower.json b/bower.json
index e070a95..c68f723 100644
--- a/bower.json
+++ b/bower.json
@@ -1,7 +1,7 @@
{
"name": "etools-searchable-multiselection-menu",
"description": "Dropdown menu with search and multiple options selection",
- "version": "2.2.8",
+ "version": "2.2.9",
"license": "https://github.com/unicef-polymer/etools-searchable-multiselection-menu/blob/master/LICENSE.md",
"main": "etools-searchable-multiselection-menu.html",
"dependencies": {
@@ -14,7 +14,8 @@
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.3.1",
"paper-icon-button": "PolymerElements/paper-icon-button#^1.1.3",
"etools-ajax": "^2.0.0",
- "paper-menu": "PolymerElements/paper-menu#^1.3.0"
+ "paper-menu": "PolymerElements/paper-menu#^1.3.0",
+ "etools-dialog": "^1.2.7"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
diff --git a/demo/demo-in-modal.html b/demo/demo-in-modal.html
new file mode 100644
index 0000000..376695c
--- /dev/null
+++ b/demo/demo-in-modal.html
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+ Single selection
+
+
+ Multi selection
+
+
+ Old esmm versions
+
+
+
+
+
diff --git a/demo/index.html b/demo/index.html
index 36e67d4..08c7e52 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -21,6 +21,7 @@
+