Files
2025-04-09 14:09:08 -05:00

14 lines
284 B
JavaScript

import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = [ "details" ]
close() {
this.detailsTarget.removeAttribute("open")
}
closeOnClickOutside({ target }) {
if (!this.element.contains(target)) this.close()
}
}