diff --git a/assets/js/components/Config/PropertyField.vue b/assets/js/components/Config/PropertyField.vue index 72f24bd9c..6c1ee9d48 100644 --- a/assets/js/components/Config/PropertyField.vue +++ b/assets/js/components/Config/PropertyField.vue @@ -75,7 +75,7 @@ :type="inputType" :placeholder="placeholder" :required="required" - :rows="rows || 4" + :rows="textareaRows" :disabled="disabled" /> @@ -254,9 +254,18 @@ export default { return ( this.rows || this.array || - ["accessToken", "refreshToken", "identifiers"].includes(this.property) + ["accessToken", "refreshToken", "identifiers", "formula"].includes(this.property) ); }, + textareaRows() { + if (this.rows) return this.rows; + const autoGrow = this.property === "formula"; + if (autoGrow) { + const lines = (this.value ?? "").split("\n").length; + return Math.max(1, lines); + } + return 4; + }, boolean() { return this.type === "Bool"; },