Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit ba139a9

Browse files
committed
row cols of textarea
1 parent 06f664a commit ba139a9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/modals/columnSettings/handlers/automations/FormulaInputHandler.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@ export class FormulaInputHandler extends AbstractHandlerClass<ColumnSettingsHand
4040
textArea.setValue(config.formula_query);
4141
textArea.setPlaceholder('Write here your formula');
4242
textArea.onChange(formula_promise);
43-
// style textarea to be bigger
44-
textArea.inputEl.setAttribute('style', 'width: 25rem; height: 10rem;');
43+
// style textarea size in function of formula length
44+
const formula_length = config.formula_query ? config.formula_query.length : 0;
45+
textArea.inputEl.rows = Math.max(4, formula_length / 30);
46+
textArea.inputEl.cols = Math.min(Math.max(10, formula_length * 2), 45);
47+
textArea.inputEl.style.width = 'auto';
48+
4549
});
4650
const mainDesc = containerEl.createEl('p');
4751

0 commit comments

Comments
 (0)