Deselect column/card selection when clicking outside

This commit is contained in:
Jorge Manrubia
2025-11-21 12:53:13 +01:00
parent 6af9ab9b6d
commit 6daccc88ae
3 changed files with 11 additions and 2 deletions
@@ -60,6 +60,14 @@ export default class extends Controller {
this.#setCurrentFrom(this.#visibleItems[this.#visibleItems.length - 1])
}
deselectWhenClickingOutside(event) {
if (this.element.contains(event.target)) {
return
}
this.#clearSelection()
}
// Public
async selectItem(item, skipFocus = false) {