Open Deuscx opened 1 year ago
Hi @xiaoluoboding,
I think I found a way to solve this problem using onClickOutside
function.
Can I contribute the solution to the project?
Another solution would be adding a listener on a parent element like the mask. You can set this on the component where the palette is mounted.
This is what i did in my repository
document.body.addEventListener('click', (event) => {
if (event.target.matches('[command-dialog-mask]')) {
if (this.ui.show) this.hide()
}
})
Is it able to support close-on-click-model like element-plus dialog https://element-plus.org/en-US/component/dialog.html#attributes