Close filters on click outside

This commit is contained in:
Jason Zimdars
2024-10-06 07:41:44 -05:00
parent 4025462602
commit dd9c7c2b96
2 changed files with 8 additions and 4 deletions
@@ -27,4 +27,8 @@ export default class extends Controller {
close() {
this.dialogTarget.close()
}
closeOnClickOutside({ target }) {
if (!this.element.contains(target)) this.close()
}
}