AAE-47042 Add auto grow support to multiline text widget (#11981)

This commit is contained in:
Alex Molodyh
2026-06-16 07:19:34 -07:00
committed by GitHub
parent 78697ee62a
commit 76fd461741
3 changed files with 38 additions and 0 deletions
@@ -2,6 +2,7 @@
class="adf-multiline-text-widget {{ field.className }}"
[class.adf-invalid]="!field.isValid && isTouched()"
[class.adf-readonly]="field.readOnly"
[class.adf-multiline-text-widget--capped]="field.params?.autoGrow === false"
>
<mat-form-field
floatPlaceholder="never"
@@ -8,6 +8,12 @@
.adf-label {
top: 20px;
}
&--capped textarea.adf-input {
max-height: 72px;
overflow-y: auto;
resize: vertical;
}
}
&-multiline-word-counter:has(.adf-multiline-word-counter-value) {
@@ -79,6 +79,37 @@ describe('MultilineTextWidgetComponentComponent', () => {
});
});
describe('auto grow', () => {
it('should not apply the capped modifier when autoGrow is not set (default unbounded)', () => {
widget.field = new FormFieldModel(new FormModel({ taskId: '<id>' }), {
type: FormFieldTypes.MULTILINE_TEXT
});
fixture.detectChanges();
expect(testingUtils.getByCSS('.adf-multiline-text-widget--capped')).toBeFalsy();
});
it('should not apply the capped modifier when autoGrow is true', () => {
widget.field = new FormFieldModel(new FormModel({ taskId: '<id>' }), {
type: FormFieldTypes.MULTILINE_TEXT,
params: { autoGrow: true }
});
fixture.detectChanges();
expect(testingUtils.getByCSS('.adf-multiline-text-widget--capped')).toBeFalsy();
});
it('should apply the capped modifier when autoGrow is false', () => {
widget.field = new FormFieldModel(new FormModel({ taskId: '<id>' }), {
type: FormFieldTypes.MULTILINE_TEXT,
params: { autoGrow: false }
});
fixture.detectChanges();
expect(testingUtils.getByCSS('.adf-multiline-text-widget--capped')).toBeTruthy();
});
});
describe('when is required', () => {
beforeEach(() => {
widget.field = new FormFieldModel(new FormModel({ taskId: '<id>' }), {