Hide the second value of constraints based on which operator is selected.

This commit is contained in:
Jan Böhmer 2022-08-20 00:39:09 +02:00
parent d3a42cd989
commit b11ef1d60d
2 changed files with 29 additions and 4 deletions

View file

@ -0,0 +1,21 @@
import {Controller} from "@hotwired/stimulus";
export default class extends Controller {
static targets = ["operator", "thingsToHide"];
connect() {
this.update();
debugger;
}
/**
* Updates the visibility state of the value2 input, based on the operator selection.
*/
update()
{
for (const thingToHide of this.thingsToHideTargets) {
thingToHide.classList.toggle("d-none", this.operatorTarget.value !== "BETWEEN");
}
}
}