2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-16 09:10:33 +03:00

feat: add dropdownShouldOpen prop (#1464)

This commit is contained in:
Jeff Sagal
2021-07-22 13:51:43 -07:00
committed by GitHub
parent 94549ff903
commit 1676947319
3 changed files with 40 additions and 1 deletions
+15 -1
View File
@@ -565,6 +565,20 @@
dropdownList.style.left = left;
dropdownList.style.width = width;
}
},
/**
* Determines whether the dropdown should be open.
* Receives the component instance as the only argument.
*
* @since v3.12.0
* @return boolean
*/
dropdownShouldOpen: {
type: Function,
default({noDrop, open, mutableLoading}) {
return noDrop ? false : open && !mutableLoading;
}
}
},
@@ -1132,7 +1146,7 @@
* @return {Boolean} True if open
*/
dropdownOpen() {
return this.noDrop ? false : this.open && !this.mutableLoading
return this.dropdownShouldOpen(this);
},
/**