vue-treeselect
vue-treeselect copied to clipboard
Close menu
Hello.
Currently menu closes only when it looses blur as I could see calling instance.closeMenu() method.
I want itself close menu when I want. How I can do that (probably with events?)
Use alwaysOpen param. Here is the example: https://vue-treeselect.js.org/#more-features
That is not exactly what I asked about. alwaysOpen just opens <VueTreeselect-MenuPortal> component. I need to close <VueTreeselect-MenuPortal> component if it is open by clicking at <VueTreeselect-Control> component itself. There should be some method which closes menu when you click outside of VueTreeselect. I want to know how can I call it.
I want itself close menu when I want
set alwaysOpen=false when you want. This is a hack. There is no direct approach.
You can use openMenu() or closeMenu() like this this.$refs['treeselect'].closeMenu()