import { Controller } from "@hotwired/stimulus";

export default class extends Controller {
    static values = {
        offset: Number
    }

    connect() {
        this.scrollToOffset();
    }

    scrollToOffset() {
        this.element.scrollTop = this.offsetValue || 0;
    }
}
