16 lines
290 B
JavaScript
16 lines
290 B
JavaScript
|
import { Controller } from "@hotwired/stimulus"
|
||
|
|
||
|
export default class extends Controller {
|
||
|
static values = {
|
||
|
updateUrl: String,
|
||
|
}
|
||
|
|
||
|
connect() {
|
||
|
this.element.addEventListener("change", this.#updateValue.bind(this))
|
||
|
}
|
||
|
|
||
|
#updateValue() {
|
||
|
this.element.requestSubmit()
|
||
|
}
|
||
|
}
|