Wire up comboboxes

This commit is contained in:
Jose Farias
2024-11-21 19:58:21 -06:00
parent aae612473c
commit f266e46b57
39 changed files with 437 additions and 132 deletions
@@ -0,0 +1,16 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = [ "element" ]
connect() {
this.observer = new IntersectionObserver(([entry]) => {
if (entry.isIntersecting) this.elementTarget.focus()
})
this.observer.observe(this.elementTarget)
}
disconnect() {
this.observer.disconnect()
}
}