Horizontal column picker

... in card perma
This commit is contained in:
Adrien Maston
2025-12-17 11:34:31 +01:00
parent a4d0c2d6bb
commit 12bc237665
4 changed files with 40 additions and 7 deletions
@@ -0,0 +1,19 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = [ "target" ]
connect() {
this.#scrollTargetIntoView()
}
#scrollTargetIntoView() {
if(this.hasTargetTarget) {
this.element.scrollTo({
top: this.targetTarget.offsetTop - this.element.offsetHeight / 2 + this.targetTarget.offsetHeight / 2,
left: this.targetTarget.offsetLeft - this.element.offsetWidth / 2 + this.targetTarget.offsetWidth / 2,
behavior: "instant"
})
}
}
}