Skip to content

Commit 69d179c

Browse files
authored
Merge pull request #449 from topcoderinc/issue-255
fixes issue 255, using textarea for form value input
2 parents 656aba1 + 5183cf9 commit 69d179c

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

src/app/components/add-value-form/add-value-form.component.html

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,17 @@
99

1010
<div *ngIf="type !== 'String'" class="add-form-list">
1111
<div class="line" *ngFor="let v of getItemArray(); let i = index">
12-
<mat-form-field *ngIf="type === 'List' || type === 'Set' || type === 'Ordered Set'">
13-
<input matInput placeholder="Value"
14-
(change)="onValueChange()"
15-
[(ngModel)]="getItemArray()[i].value">
16-
</mat-form-field>
17-
18-
<mat-form-field *ngIf="type === 'Ordered Set'">
19-
<input matInput type="number" placeholder="Score"
20-
(change)="onValueChange()"
21-
[(ngModel)]="getItemArray()[i].score"
22-
type="number">
23-
</mat-form-field>
24-
2512
<mat-form-field *ngIf="type === 'Hash Map'" style="flex-grow:0">
26-
<input matInput placeholder="Key"
13+
<textarea matInput placeholder="Key"
2714
[readonly]="isEditMode && !v.isNew"
2815
(change)="onValueChange()"
29-
[(ngModel)]="getItemArray()[i].key">
16+
[(ngModel)]="getItemArray()[i].key"
17+
cdkTextareaAutosize
18+
cdkAutosizeMinRows="1"
19+
cdkAutosizeMaxRows="7"></textarea>
3020
</mat-form-field>
3121

32-
<mat-form-field *ngIf="type === 'Hash Map'">
22+
<mat-form-field *ngIf="type === 'List' || type === 'Set' || type === 'Ordered Set' || type === 'Hash Map'">
3323
<textarea matInput placeholder="Value"
3424
(change)="onValueChange()"
3525
[(ngModel)]="getItemArray()[i].value"
@@ -38,6 +28,13 @@
3828
cdkAutosizeMaxRows="7"></textarea>
3929
</mat-form-field>
4030

31+
<mat-form-field *ngIf="type === 'Ordered Set'">
32+
<input matInput type="number" placeholder="Score"
33+
(change)="onValueChange()"
34+
[(ngModel)]="getItemArray()[i].score"
35+
type="number">
36+
</mat-form-field>
37+
4138
<button mat-icon-button (click)="onRemoveItem(getItemArray(),i)" *ngIf="!isEditMode && getItemArray().length > 1"
4239
matTooltip="Delete">
4340
<i class="material-icons delete-icon">delete</i>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy